… | |
… | |
1134 | C<EVBACKEND_POLL>. |
1134 | C<EVBACKEND_POLL>. |
1135 | |
1135 | |
1136 | =head3 The special problem of SIGPIPE |
1136 | =head3 The special problem of SIGPIPE |
1137 | |
1137 | |
1138 | While not really specific to libev, it is easy to forget about SIGPIPE: |
1138 | While not really specific to libev, it is easy to forget about SIGPIPE: |
1139 | when reading from a pipe whose other end has been closed, your program |
1139 | when writing to a pipe whose other end has been closed, your program gets |
1140 | gets send a SIGPIPE, which, by default, aborts your program. For most |
1140 | send a SIGPIPE, which, by default, aborts your program. For most programs |
1141 | programs this is sensible behaviour, for daemons, this is usually |
1141 | this is sensible behaviour, for daemons, this is usually undesirable. |
1142 | undesirable. |
|
|
1143 | |
1142 | |
1144 | So when you encounter spurious, unexplained daemon exits, make sure you |
1143 | So when you encounter spurious, unexplained daemon exits, make sure you |
1145 | ignore SIGPIPE (and maybe make sure you log the exit status of your daemon |
1144 | ignore SIGPIPE (and maybe make sure you log the exit status of your daemon |
1146 | somewhere, as that would have given you a big clue). |
1145 | somewhere, as that would have given you a big clue). |
1147 | |
1146 | |