Changeset e2cc848
- Timestamp:
- May 23, 2011, 8:57:46 PM (13 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- 1491439
- Parents:
- 81db142
- git-author:
- David Benjamin <davidben@mit.edu> (02/26/11 20:35:26)
- git-committer:
- David Benjamin <davidben@mit.edu> (05/23/11 20:57:46)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
filterproc.c
rd564c3d re2cc848 17 17 int err = 0; 18 18 struct pollfd fds[2]; 19 struct sigaction sig = {.sa_handler = SIG_IGN}, old;20 19 21 20 fcntl(rfd, F_SETFL, O_NONBLOCK | fcntl(rfd, F_GETFL)); … … 27 26 fds[1].events = POLLOUT; 28 27 29 sigaction(SIGPIPE, &sig, &old);30 31 28 while(1) { 32 29 if(out && *out) { … … 67 64 68 65 *in = g_string_free(str, err < 0); 69 sigaction(SIGPIPE, &old, NULL);70 66 return err; 71 67 } -
owl.c
r81db142 re2cc848 358 358 359 359 owl_function_debugmsg("Got signal %d", sig); 360 /* TODO: These don't need to be re-entrant anymore! */361 360 if (sig == SIGWINCH) { 362 /* we can't inturrupt a malloc here, so it just sets a flag363 * schedulding a resize for later364 */365 361 owl_function_resize(); 366 } else if (sig == SIGPIPE || sig == SIGCHLD) {367 owl_function_error("Got unexpected signal: %d %s",368 sig, (sig == SIGPIPE) ? "SIGPIPE" : "SIGCHLD");369 362 } else if (sig == SIGTERM || sig == SIGHUP) { 370 363 owl_function_quit(); … … 394 387 395 388 void owl_register_signal_handlers(void) { 389 struct sigaction ignore = { .sa_handler = SIG_IGN }; 396 390 sigset_t sigset; 397 391 392 /* Turn off SIGPIPE; we check the return value of write. */ 393 sigaction(SIGPIPE, &ignore, NULL); 394 395 /* Register some signals with the signal thread. */ 398 396 sigemptyset(&sigset); 399 397 sigaddset(&sigset, SIGWINCH); 400 398 sigaddset(&sigset, SIGALRM); 401 sigaddset(&sigset, SIGPIPE);402 399 sigaddset(&sigset, SIGTERM); 403 400 sigaddset(&sigset, SIGHUP); 404 401 sigaddset(&sigset, SIGINT); 405 406 402 owl_signal_init(&sigset, sig_handler, g_main_context_default()); 407 403 }
Note: See TracChangeset
for help on using the changeset viewer.