chiark / gitweb /
udev: check return value of uname.
authorVáclav Pavlín <vpavlin@redhat.com>
Wed, 27 Mar 2013 14:16:36 +0000 (15:16 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 29 Mar 2013 03:45:58 +0000 (23:45 -0400)
src/udev/udevd.c

index 2ad73881d6cdcead779a52bbb3eb1be9ff0a0c39..42cf994b0d8d7887cf9aafb8316e5d4e00d3db75 100644 (file)
@@ -819,7 +819,11 @@ static void static_dev_create_from_modules(struct udev *udev)
         char buf[4096];
         FILE *f;
 
-        uname(&kernel);
+        if (uname(&kernel) < 0) {
+                log_error("uname failed: %m");
+                return;
+        }
+
         strscpyl(modules, sizeof(modules), ROOTPREFIX "/lib/modules/", kernel.release, "/modules.devname", NULL);
         f = fopen(modules, "re");
         if (f == NULL)