1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-10 05:18:36 +03:00

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.
This commit is contained in:
zkabelac 2010-01-14 10:11:26 +00:00
parent 79ba99811c
commit 8c71113cd6

View File

@ -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)