chiark / gitweb /
pass CROSS_COMPILE to AR and RANLIB down to extras/
[elogind.git] / udev_add.c
index 2c66a0ba8d071733a4d69923cca38f573472e97e..6c023ab968adc783546a437a38a611b5588b5b05 100644 (file)
 #include <fcntl.h>
 #include <unistd.h>
 #include <errno.h>
+#include <grp.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-#include <grp.h>
-#include <net/if.h>
+#include <sys/socket.h>
 #include <sys/ioctl.h>
+#include <net/if.h>
 #include <linux/sockios.h>
 
 #include "udev.h"
@@ -53,7 +54,7 @@ int udev_make_node(struct udevice *udev, const char *file, dev_t devt, mode_t mo
 
        /* preserve node with already correct numbers, to prevent changing the inode number */
        if ((stats.st_mode & S_IFMT) == (mode & S_IFMT) && (stats.st_rdev == devt)) {
-               info("preserve file '%s', cause it has correct dev_t", file);
+               info("preserve file '%s', because it has correct dev_t", file);
                selinux_setfilecon(file, udev->dev->kernel_name, stats.st_mode);
                goto perms;
        }
@@ -135,16 +136,14 @@ static int create_node(struct udevice *udev)
                        gid = lookup_group(udev->group);
        }
 
-       if (!udev->test_run) {
-               info("creating device node '%s'", filename);
+       info("creating device node '%s', major = '%d', minor = '%d', " "mode = '%#o', uid = '%d', gid = '%d'",
+            filename, major(udev->devt), minor(udev->devt), udev->mode, uid, gid);
+
+       if (!udev->test_run)
                if (udev_make_node(udev, filename, udev->devt, udev->mode, uid, gid) != 0)
                        goto error;
-               setenv("DEVNAME", filename, 1);
-       } else {
-               info("creating device node '%s', major = '%d', minor = '%d', "
-                    "mode = '%#o', uid = '%d', gid = '%d'", filename,
-                    major(udev->devt), minor(udev->devt), udev->mode, uid, gid);
-       }
+
+       setenv("DEVNAME", filename, 1);
 
        /* create all_partitions if requested */
        if (udev->partitions) {
@@ -280,7 +279,7 @@ int udev_add_device(struct udevice *udev)
                                goto exit;
 
                        info("renamed netif to '%s'", udev->name);
-                       /* we've changed the name, now fake the devpath, cause the
+                       /* we've changed the name, now fake the devpath, because the
                         * original kernel name sleeps with the fishes and we don't
                         * get an event from the kernel with the new name
                         */