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 2ad7388..42cf994 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)