cant block sigcld globally cause qt needs it
This commit is contained in:
parent
8e51cf42d3
commit
73a7e3770e
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: rclinit.cpp,v 1.9 2007-05-21 13:30:21 dockes Exp $ (C) 2004 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: rclinit.cpp,v 1.10 2007-05-23 08:28:35 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -41,12 +41,10 @@ RclConfig *recollinit(RclInitFlags flags,
|
|||||||
// must check write() return values.
|
// must check write() return values.
|
||||||
signal(SIGPIPE, SIG_IGN);
|
signal(SIGPIPE, SIG_IGN);
|
||||||
|
|
||||||
// We block SIGCLD globally. We intend to properly wait for our children
|
// We would like to block SIGCHLD globally, but we can't because
|
||||||
sigset_t sset;
|
// QT uses it. Have to block it inside execmd.cpp
|
||||||
sigemptyset(&sset);
|
|
||||||
sigaddset(&sset, SIGCHLD);
|
|
||||||
pthread_sigmask(SIG_BLOCK, &sset, 0);
|
|
||||||
|
|
||||||
|
// Install signal handler
|
||||||
if (sigcleanup) {
|
if (sigcleanup) {
|
||||||
for (unsigned int i = 0; i < sizeof(catchedSigs) / sizeof(int); i++)
|
for (unsigned int i = 0; i < sizeof(catchedSigs) / sizeof(int); i++)
|
||||||
if (signal(catchedSigs[i], SIG_IGN) != SIG_IGN)
|
if (signal(catchedSigs[i], SIG_IGN) != SIG_IGN)
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#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
|
#endif
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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) {
|
if (e.pid) {
|
||||||
// Father process
|
// Father process
|
||||||
|
sigset_t blkcld;
|
||||||
|
sigemptyset(&blkcld);
|
||||||
|
sigaddset(&blkcld, SIGCHLD);
|
||||||
|
pthread_sigmask(SIG_BLOCK, &blkcld, 0);
|
||||||
|
|
||||||
if (input) {
|
if (input) {
|
||||||
close(e.pipein[0]);
|
close(e.pipein[0]);
|
||||||
e.pipein[0] = -1;
|
e.pipein[0] = -1;
|
||||||
@ -280,6 +285,8 @@ int ExecCmd::doexec(const string &cmd, const list<string>& args,
|
|||||||
e.pid = -1;
|
e.pid = -1;
|
||||||
}
|
}
|
||||||
LOGDEB1(("ExecCmd::doexec: father got status 0x%x\n", status));
|
LOGDEB1(("ExecCmd::doexec: father got status 0x%x\n", status));
|
||||||
|
pthread_sigmask(SIG_UNBLOCK, &blkcld, 0);
|
||||||
|
|
||||||
return haderror ? -1 : status;
|
return haderror ? -1 : status;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user