mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-11 20:58:50 +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:
parent
4269e36315
commit
5a4eeb69c4
@ -398,6 +398,8 @@ static int _start_daemon(struct dm_event_fifos *fifos)
|
|||||||
int pid, ret = 0;
|
int pid, ret = 0;
|
||||||
int status;
|
int status;
|
||||||
struct stat statbuf;
|
struct stat statbuf;
|
||||||
|
char dmeventdpath[] = DMEVENTD_PATH; /* const type for execvp */
|
||||||
|
char * const args[] = { dmeventdpath, NULL };
|
||||||
|
|
||||||
if (stat(fifos->client_path, &statbuf))
|
if (stat(fifos->client_path, &statbuf))
|
||||||
goto start_server;
|
goto start_server;
|
||||||
@ -437,7 +439,7 @@ static int _start_daemon(struct dm_event_fifos *fifos)
|
|||||||
log_error("Unable to fork.");
|
log_error("Unable to fork.");
|
||||||
|
|
||||||
else if (!pid) {
|
else if (!pid) {
|
||||||
execvp(DMEVENTD_PATH, NULL);
|
execvp(args[0], args);
|
||||||
_exit(EXIT_FAILURE);
|
_exit(EXIT_FAILURE);
|
||||||
} else {
|
} else {
|
||||||
if (waitpid(pid, &status, 0) < 0)
|
if (waitpid(pid, &status, 0) < 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user