Changeset c9e72d1
- Timestamp:
- Nov 22, 2003, 11:33:00 AM (19 years ago)
- Branches:
- master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 1e34e40
- Parents:
- f1645da
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
rf1645da rc9e72d1 1 1 $Id$ 2 2 3 2.0.13-pre- 13 2.0.13-pre-2 4 4 Changed startup message for new mailing list 5 5 blist now prints AIM info even if .anyone is unreadable 6 Catch SIGPIPE and print an error rather than crashing. 7 [It's possible that this may have some portability 8 issues under Solaris and we may need to add some 9 configure stuff around SA_SIGINFO...] 6 10 7 11 2.0.12 -
global.c
r5a9f6fe rc9e72d1 105 105 106 106 owl_errqueue_init(&(g->errqueue)); 107 108 g->got_err_signal=0; 107 109 } 108 110 … … 844 846 return(&(g->errqueue)); 845 847 } 848 849 void owl_global_set_errsignal(owl_global *g, int signum, siginfo_t *siginfo) 850 { 851 g->got_err_signal = signum; 852 if (siginfo) { 853 g->err_signal_info = *siginfo; 854 } else { 855 memset(&(g->err_signal_info), 0, sizeof(siginfo_t)); 856 } 857 } 858 859 int owl_global_get_errsignal_and_clear(owl_global *g, siginfo_t *siginfo) 860 { 861 int signum; 862 if (siginfo && g->got_err_signal) { 863 *siginfo = g->err_signal_info; 864 } 865 signum = g->got_err_signal; 866 g->got_err_signal = 0; 867 return signum; 868 } 869 -
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 -
owl.h
r52f3507 rc9e72d1 8 8 #include <regex.h> 9 9 #include <time.h> 10 #include <signal.h> 10 11 #include <libfaim/aim.h> 11 12 #include "config.h" … … 19 20 static const char owl_h_fileIdent[] = "$Id$"; 20 21 21 #define OWL_VERSION 2.0.13-pre- 122 #define OWL_VERSION_STRING "2.0.13-pre- 1"22 #define OWL_VERSION 2.0.13-pre-2 23 #define OWL_VERSION_STRING "2.0.13-pre-2" 23 24 24 25 /* Feature that is being tested to redirect stderr through a pipe. … … 486 487 int havezephyr; 487 488 int haveaim; 489 int got_err_signal; /* 1 if we got an unexpected signal */ 490 siginfo_t err_signal_info; 488 491 } owl_global; 489 492
Note: See TracChangeset
for help on using the changeset viewer.