#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"
/* 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;
}
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) {
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
*/