From 8c71113cd6b80eaf402ad2e24e2f2f03105b9a39 Mon Sep 17 00:00:00 2001 From: zkabelac Date: Thu, 14 Jan 2010 10:11:26 +0000 Subject: [PATCH] Cleanup gcc warning: null argument where non-null required (arg.2) As the const declaration of execvp is a bit weird, using local dmeventdpath string. --- daemons/dmeventd/libdevmapper-event.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/daemons/dmeventd/libdevmapper-event.c b/daemons/dmeventd/libdevmapper-event.c index 20d925e2b..4dfdf6914 100644 --- a/daemons/dmeventd/libdevmapper-event.c +++ b/daemons/dmeventd/libdevmapper-event.c @@ -398,6 +398,8 @@ static int _start_daemon(struct dm_event_fifos *fifos) int pid, ret = 0; int status; struct stat statbuf; + char dmeventdpath[] = DMEVENTD_PATH; /* const type for execvp */ + char * const args[] = { dmeventdpath, NULL }; if (stat(fifos->client_path, &statbuf)) goto start_server; @@ -437,7 +439,7 @@ static int _start_daemon(struct dm_event_fifos *fifos) log_error("Unable to fork."); else if (!pid) { - execvp(DMEVENTD_PATH, NULL); + execvp(args[0], args); _exit(EXIT_FAILURE); } else { if (waitpid(pid, &status, 0) < 0)