diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2011-02-24 12:12:27 +0000 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2011-02-25 11:02:08 +0000 |
commit | f0e9dfeca967d05f23409c838619d9357d4f7d7f (patch) | |
tree | c83021380428f225dc79b3cab8af7d6498995288 /tests/commandtest.c | |
parent | Fix spelling mistake: seek (diff) | |
download | libvirt-f0e9dfeca967d05f23409c838619d9357d4f7d7f.tar.gz libvirt-f0e9dfeca967d05f23409c838619d9357d4f7d7f.tar.bz2 libvirt-f0e9dfeca967d05f23409c838619d9357d4f7d7f.zip |
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()
Diffstat (limited to 'tests/commandtest.c')
-rw-r--r-- | tests/commandtest.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/commandtest.c b/tests/commandtest.c index 7157c5132..dc2f8a124 100644 --- a/tests/commandtest.c +++ b/tests/commandtest.c @@ -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; |