X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubox.git;a=blobdiff_plain;f=kmodloader.c;h=86e3f447c4096b7101ddb640f775e9eb3e8ca89c;hp=8f41e749c7f3edc492f3b86abd1778efcdf1dc95;hb=b0d5399c3db83c2c8f9d8aae944f873343b3a038;hpb=96aa9306d5cc7ebb804ee27f1a920dbd7ef83c17 diff --git a/kmodloader.c b/kmodloader.c index 8f41e74..86e3f44 100644 --- a/kmodloader.c +++ b/kmodloader.c @@ -281,7 +281,7 @@ static struct module* get_module_info(const char *module, const char *name) struct module *m; struct stat s; - if (!fd) { + if (fd < 0) { ULOG_ERR("failed to open %s\n", module); return NULL; } @@ -381,7 +381,7 @@ static int print_modinfo(char *module) struct stat s; char *map, *strings; - if (!fd) { + if (fd < 0) { ULOG_ERR("failed to open %s\n", module); return -1; } @@ -466,7 +466,7 @@ static int insert_module(char *path, const char *options) } fd = open(path, O_RDONLY); - if (!fd) { + if (fd < 0) { ULOG_ERR("cannot open %s\n", path); return ret; } @@ -751,7 +751,7 @@ static int main_loader(int argc, char **argv) if (scan_module_folders()) return -1; - syslog(0, "kmodloader: loading kernel modules from %s\n", path); + syslog(LOG_INFO, "kmodloader: loading kernel modules from %s\n", path); if (glob(path, gl_flags, NULL, &gl) < 0) goto out;