mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-23 22:55:46 +00:00
Use PATH lookup for systemctl in systemd meter
Before this change, the systemd meter was broken on distros like NixOS, which have systemctl in PATH, but not at /bin/systemctl. After the change, it works on all my NixOS machines.
This commit is contained in:
parent
df435931b6
commit
d45b4f4a43
@ -219,15 +219,15 @@ static void updateViaExec(void) {
|
||||
exit(1);
|
||||
dup2(fdnull, STDERR_FILENO);
|
||||
close(fdnull);
|
||||
execl("/bin/systemctl",
|
||||
"/bin/systemctl",
|
||||
"show",
|
||||
"--property=SystemState",
|
||||
"--property=NFailedUnits",
|
||||
"--property=NNames",
|
||||
"--property=NJobs",
|
||||
"--property=NInstalledJobs",
|
||||
NULL);
|
||||
execlp("systemctl",
|
||||
"systemctl",
|
||||
"show",
|
||||
"--property=SystemState",
|
||||
"--property=NFailedUnits",
|
||||
"--property=NNames",
|
||||
"--property=NJobs",
|
||||
"--property=NInstalledJobs",
|
||||
NULL);
|
||||
exit(127);
|
||||
}
|
||||
close(fdpair[1]);
|
||||
|
Loading…
Reference in New Issue
Block a user