mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-09-30 17:45:19 +03:00
Make commandtest more robust wrt its execution environment
When executed from cron, commandtest would fail to correctly identify daemon processes. Set session ID and process group IDs at startup to ensure we have a consistent environment to run in. * tests/commandtest.c: Call setsid() and setpgid()
This commit is contained in:
@@ -730,6 +730,9 @@ mymain(int argc, char **argv)
|
||||
if (chdir("/tmp") < 0)
|
||||
return(EXIT_FAILURE);
|
||||
|
||||
setpgid(0, 0);
|
||||
setsid();
|
||||
|
||||
/* Kill off any inherited fds that might interfere with our
|
||||
* testing. */
|
||||
fd = 3;
|
||||
|
Reference in New Issue
Block a user