summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cdinit.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/cdinit.c b/cdinit.c
index aadae37..f5ccb22 100644
--- a/cdinit.c
+++ b/cdinit.c
@@ -33,23 +33,8 @@
*/
const char *get_param(const char *param, const char *def)
{
- int cmd_fd;
-
- if(access("/proc/cmdline", R_OK) != 0)
- {
- fprintf(stderr, "can't access kernel command line\n");
- return def;
- }
-
- cmd_fd = open("/proc/cmdline", O_RDONLY);
- if(cmd_fd == -1)
- {
- fprintf(stderr, "can't open kernel command line\n");
- return def;
- }
-
- close(cmd_fd);
- return def;
+ char *str = getenv(param);
+ return str ? str : def;
}
/*!