summaryrefslogtreecommitdiff
path: root/udevd.c
diff options
context:
space:
mode:
Diffstat (limited to 'udevd.c')
-rw-r--r--udevd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/udevd.c b/udevd.c
index bb956b520c..0702f5e2cb 100644
--- a/udevd.c
+++ b/udevd.c
@@ -926,12 +926,6 @@ int main(int argc, char *argv[], char *envp[])
selinux_init();
dbg("version %s", UDEV_VERSION);
- if (getuid() != 0) {
- fprintf(stderr, "root privileges required\n");
- err("root privileges required");
- goto exit;
- }
-
/* parse commandline options */
for (i = 1 ; i < argc; i++) {
char *arg = argv[i];
@@ -946,6 +940,12 @@ int main(int argc, char *argv[], char *envp[])
}
}
+ if (getuid() != 0) {
+ fprintf(stderr, "root privileges required\n");
+ err("root privileges required");
+ goto exit;
+ }
+
/* init sockets to receive events */
if (init_udevd_socket() < 0) {
if (errno == EADDRINUSE) {