Thu, 07 Apr 2005 14:55:02 +0000
[gaim-migrate @ 12431]
" The following log snippets should explain it: " --rlaager
(20:24:00) rlaager: Regarding the signal handling
conversation the other day... I've written a patch to stop
calling signal handlers and return as soon as we find one
signal handler that returns TRUE to indicate that it's
handled the signal. Is this the right approach?
(20:24:22) Ethan Blanton (Paco-Paco): the trouble is that it's
documented to behave exactly the way it does
(20:24:31) Ethan Blanton (Paco-Paco): so changing it is
notbackwards compatible
(20:24:31) rlaager: I'm talking for HEAD.
(20:24:41) Ethan Blanton (Paco-Paco): oh, I think that's a
good approach, yes
(20:24:53) rlaager: The way I've described is how I
*expected* it to work, having not read the documentation.
(20:25:09) Ethan Blanton (Paco-Paco): I'm convinced
(20:27:04) Stu Tomlinson (nosnilmot): rlaager: this, I
assume, breaks the generic-ness of signals, by assuming
that any that return values return booleans?
(20:27:26) Ethan Blanton (Paco-Paco): please break it
(20:27:33) Ethan Blanton (Paco-Paco): we already have
out-parameters
(20:27:42) rlaager: nosnilmot: from what I can see, the
return type is handled as a (void *)... so I'm checking that
ret_value != NULL
(20:27:57) rlaager: nosnilmot: that's the correct way to do it,
right?
...
(20:29:01) Ethan Blanton (Paco-Paco): allowing a
meaningful return value is an over-engineering
(20:30:07) rlaager: even after this patch, you should be able
to return meaningful return values
(20:30:15) rlaager: it'll just short-circuit on the first handler
that does
committer: Luke Schierer <lschiere@pidgin.im>
| 2086 | 1 | /* |
| 2 | * Copyright 1987 by MIT Student Information Processing Board | |
| 3 | * | |
| 4 | * For copyright info, see mit-sipb-copyright.h. | |
| 5 | */ | |
| 6 | ||
| 7 | #include <sysdep.h> | |
| 8354 | 8 | /* #include "error_table.h" */ |
| 2086 | 9 | #include "mit-sipb-copyright.h" |
| 10 | ||
| 8354 | 11 | |
| 12 | #define ERRCODE_RANGE 8 /* # of bits to shift table number */ | |
| 13 | #define BITS_PER_CHAR 6 /* # bits to shift per character in name */ | |
| 14 | ||
| 15 | ||
| 2086 | 16 | #ifndef lint |
| 17 | static const char copyright[] = | |
| 18 | "Copyright 1987,1988 by Student Information Processing Board, Massachusetts Institute of Technology"; | |
| 19 | static const char rcsid_et_name_c[] = | |
| 20 | "$Header$"; | |
| 21 | #endif | |
| 22 | ||
| 23 | static const char char_set[] = | |
| 24 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_"; | |
| 25 | ||
| 26 | const char * error_table_name_r(num, buf) | |
| 27 | int num; | |
| 28 | char *buf; | |
| 29 | { | |
| 30 | int ch; | |
| 31 | int i; | |
| 32 | char *p; | |
| 33 | ||
| 34 | /* num = aa aaa abb bbb bcc ccc cdd ddd d?? ??? ??? */ | |
| 35 | p = buf; | |
| 36 | num >>= ERRCODE_RANGE; | |
| 37 | /* num = ?? ??? ??? aaa aaa bbb bbb ccc ccc ddd ddd */ | |
| 38 | num &= 077777777; | |
| 39 | /* num = 00 000 000 aaa aaa bbb bbb ccc ccc ddd ddd */ | |
| 40 | for (i = 4; i >= 0; i--) { | |
| 41 | ch = (num >> BITS_PER_CHAR * i) & ((1 << BITS_PER_CHAR) - 1); | |
| 42 | if (ch != 0) | |
| 43 | *p++ = char_set[ch-1]; | |
| 44 | } | |
| 45 | *p = '\0'; | |
| 46 | return(buf); | |
| 47 | } | |
| 48 | ||
| 49 | const char * error_table_name(num) | |
| 50 | int num; | |
| 51 | { | |
| 52 | static char buf[6]; | |
| 53 | ||
| 54 | return(error_table_name_r(num, buf)); | |
| 55 | } | |
| 56 |