cant block sigcld globally cause qt needs it

This commit is contained in:
dockes
2007-05-23 08:28:35 +00:00
parent 8e51cf42d3
commit 73a7e3770e
2 changed files with 12 additions and 7 deletions
+8 -1
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: execmd.cpp,v 1.23 2007-05-21 13:30:22 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: execmd.cpp,v 1.24 2007-05-23 08:28:35 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -180,6 +180,11 @@ int ExecCmd::doexec(const string &cmd, const list<string>& args,
if (e.pid) {
// Father process
sigset_t blkcld;
sigemptyset(&blkcld);
sigaddset(&blkcld, SIGCHLD);
pthread_sigmask(SIG_BLOCK, &blkcld, 0);
if (input) {
close(e.pipein[0]);
e.pipein[0] = -1;
@@ -280,6 +285,8 @@ int ExecCmd::doexec(const string &cmd, const list<string>& args,
e.pid = -1;
}
LOGDEB1(("ExecCmd::doexec: father got status 0x%x\n", status));
pthread_sigmask(SIG_UNBLOCK, &blkcld, 0);
return haderror ? -1 : status;
} else {