|
a/src/common/rclinit.cpp |
|
b/src/common/rclinit.cpp |
1 |
#ifndef lint
|
1 |
#ifndef lint
|
2 |
static char rcsid[] = "@(#$Id: rclinit.cpp,v 1.9 2007-05-21 13:30:21 dockes Exp $ (C) 2004 J.F.Dockes";
|
2 |
static char rcsid[] = "@(#$Id: rclinit.cpp,v 1.10 2007-05-23 08:28:35 dockes Exp $ (C) 2004 J.F.Dockes";
|
3 |
#endif
|
3 |
#endif
|
4 |
/*
|
4 |
/*
|
5 |
* This program is free software; you can redistribute it and/or modify
|
5 |
* This program is free software; you can redistribute it and/or modify
|
6 |
* it under the terms of the GNU General Public License as published by
|
6 |
* it under the terms of the GNU General Public License as published by
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
|
... |
|
... |
39 |
|
39 |
|
40 |
// We ignore SIGPIPE always. All pieces of code which can write to a pipe
|
40 |
// We ignore SIGPIPE always. All pieces of code which can write to a pipe
|
41 |
// must check write() return values.
|
41 |
// must check write() return values.
|
42 |
signal(SIGPIPE, SIG_IGN);
|
42 |
signal(SIGPIPE, SIG_IGN);
|
43 |
|
43 |
|
44 |
// We block SIGCLD globally. We intend to properly wait for our children
|
44 |
// We would like to block SIGCHLD globally, but we can't because
|
45 |
sigset_t sset;
|
45 |
// QT uses it. Have to block it inside execmd.cpp
|
46 |
sigemptyset(&sset);
|
|
|
47 |
sigaddset(&sset, SIGCHLD);
|
|
|
48 |
pthread_sigmask(SIG_BLOCK, &sset, 0);
|
|
|
49 |
|
46 |
|
|
|
47 |
// Install signal handler
|
50 |
if (sigcleanup) {
|
48 |
if (sigcleanup) {
|
51 |
for (unsigned int i = 0; i < sizeof(catchedSigs) / sizeof(int); i++)
|
49 |
for (unsigned int i = 0; i < sizeof(catchedSigs) / sizeof(int); i++)
|
52 |
if (signal(catchedSigs[i], SIG_IGN) != SIG_IGN)
|
50 |
if (signal(catchedSigs[i], SIG_IGN) != SIG_IGN)
|
53 |
signal(catchedSigs[i], sigcleanup);
|
51 |
signal(catchedSigs[i], sigcleanup);
|
54 |
}
|
52 |
}
|