- if (argc == 2 && strcmp(argv[1], "-V") == 0) {
- printf("%s\n", UDEV_VERSION);
- exit(0);
- }
-
- /* set std fd's to /dev/null, /sbin/hotplug forks us, we don't have them at all */
- devnull = open("/dev/null", O_RDWR);
- if (devnull >= 0) {
- if (devnull != STDIN_FILENO)
- dup2(devnull, STDIN_FILENO);
- if (devnull != STDOUT_FILENO)
- dup2(devnull, STDOUT_FILENO);
- if (devnull != STDERR_FILENO)
- dup2(devnull, STDERR_FILENO);
- if (devnull > STDERR_FILENO)
- close(devnull);
- }
-
- logging_init("udev");
- if (devnull < 0)
- err("open /dev/null failed: %s\n", strerror(errno));
- udev_config_init();
- selinux_init();
- dbg("version %s\n", UDEV_VERSION);