summaryrefslogtreecommitdiff
path: root/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'scsi')
-rw-r--r--scsi/qemu-pr-helper.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/scsi/qemu-pr-helper.c b/scsi/qemu-pr-helper.c
index 21e1b8ea60..eeff80acf2 100644
--- a/scsi/qemu-pr-helper.c
+++ b/scsi/qemu-pr-helper.c
@@ -1081,13 +1081,6 @@ int main(int argc, char **argv)
accept_client,
NULL, NULL);
-#ifdef CONFIG_LIBCAP
- if (drop_privileges() < 0) {
- error_report("Failed to drop privileges: %s", strerror(errno));
- exit(EXIT_FAILURE);
- }
-#endif
-
if (daemonize) {
if (daemon(0, 0) < 0) {
error_report("Failed to daemonize: %s", strerror(errno));
@@ -1096,6 +1089,13 @@ int main(int argc, char **argv)
write_pidfile();
}
+#ifdef CONFIG_LIBCAP
+ if (drop_privileges() < 0) {
+ error_report("Failed to drop privileges: %s", strerror(errno));
+ exit(EXIT_FAILURE);
+ }
+#endif
+
state = RUNNING;
do {
main_loop_wait(false);