diff options
author | Explorer09 <explorer09@gmail.com> | 2022-05-17 19:15:37 +0800 |
---|---|---|
committer | Explorer09 <explorer09@gmail.com> | 2022-05-19 18:42:44 +0800 |
commit | 44091705dbdb2e3751c03e4935b1e5a7cf169241 (patch) | |
tree | 450068f9dbb71b4e9914d30f25aae6755353ff76 /linux/SystemdMeter.c | |
parent | 87793b85552de1a67eb7a779c745ed02d04322bf (diff) |
Use of NULL in execlp() must have a pointer cast.
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
Diffstat (limited to 'linux/SystemdMeter.c')
-rw-r--r-- | linux/SystemdMeter.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/linux/SystemdMeter.c b/linux/SystemdMeter.c index 567cfc7c..297cc253 100644 --- a/linux/SystemdMeter.c +++ b/linux/SystemdMeter.c @@ -219,6 +219,8 @@ static void updateViaExec(void) { exit(1); dup2(fdnull, STDERR_FILENO); close(fdnull); + // Use of NULL in variadic functions must have a pointer cast. + // The NULL constant is not required by standard to have a pointer type. execlp("systemctl", "systemctl", "show", @@ -227,7 +229,7 @@ static void updateViaExec(void) { "--property=NNames", "--property=NJobs", "--property=NInstalledJobs", - NULL); + (char *)NULL); exit(127); } close(fdpair[1]); |