diff options
-rw-r--r-- | cdinit.c | 19 |
1 files changed, 2 insertions, 17 deletions
@@ -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; } /*! |