~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to trampoline/trampoline.c

  • Committer: dcoles
  • Date: 2008-08-21 07:31:47 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:1039
Trampoline: Make trampoline remove any signal masking done by the calling 
process (Caused by Apache mpm-worker or python when using threads)

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
#include <sys/time.h>
45
45
#include <sys/resource.h>
46
46
#include <limits.h>
 
47
#include <signal.h>
47
48
 
48
49
/* conf.h is admin-configured by the setup process.
49
50
 * It defines jail_base.
199
200
}
200
201
#endif /* IVLE_AUFS_JAILS */
201
202
 
 
203
/* Unsets any signal mask applied by the parent process */
 
204
void unmask_signals()
 
205
{
 
206
    sigset_t* sigset;
 
207
    sigset = die_if_null(malloc(sizeof(sigset_t)));
 
208
    sigemptyset(sigset);
 
209
    sigprocmask(SIG_SETMASK, sigset, NULL);
 
210
    free(sigset);
 
211
}
 
212
 
202
213
int main(int argc, char* const argv[])
203
214
{
204
215
    char* jailpath;
234
245
        arg_num++;
235
246
    }
236
247
 
 
248
    unmask_signals();
 
249
 
237
250
    if (strcmp(argv[arg_num], "-u") == 0)
238
251
    {
239
252
        if (argc < 6)