- Timestamp:
- Nov 22, 2003, 11:33:00 AM (20 years ago)
- Branches:
- master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 1e34e40
- Parents:
- f1645da
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
owl.c
ra0a5179 rc9e72d1 118 118 /* signal handler */ 119 119 owl_function_debugmsg("startup: setting up signal handler"); 120 sigact.sa_handler=sig_handler; 120 /*sigact.sa_handler=sig_handler;*/ 121 sigact.sa_sigaction=sig_handler; 121 122 sigemptyset(&sigact.sa_mask); 122 sigact.sa_flags= 0;123 sigact.sa_flags=SA_SIGINFO; 123 124 sigaction(SIGWINCH, &sigact, NULL); 124 125 sigaction(SIGALRM, &sigact, NULL); 126 sigaction(SIGPIPE, &sigact, NULL); 125 127 126 128 /* screen init */ … … 589 591 #endif 590 592 593 /* Log any error signals */ 594 { 595 siginfo_t si; 596 int signum; 597 if ((signum = owl_global_get_errsignal_and_clear(&g, &si)) > 0) { 598 owl_function_error("Got unexpected signal: %d %s (code: %d fd: %d band: %d errno: %d)", 599 signum, signum==SIGPIPE?"SIGPIPE":"", 600 si.si_code, si.si_fd, si.si_band, si.si_errno); 601 } 602 } 603 591 604 } 592 605 } 593 606 594 void sig_handler(int sig ) {607 void sig_handler(int sig, siginfo_t *si, void *data) { 595 608 if (sig==SIGWINCH) { 596 609 /* we can't inturrupt a malloc here, so it just sets a flag … … 598 611 */ 599 612 owl_function_resize(); 600 } 613 } else if (sig==SIGPIPE) { 614 /* Set a flag and some info that we got the sigpipe 615 * so we can record that we got it and why... */ 616 owl_global_set_errsignal(&g, sig, si); 617 } 618 601 619 } 602 620
Note: See TracChangeset
for help on using the changeset viewer.