>>>>> "K" == Kero van Gelder <kero / chello.single-dot.nl> writes:

K> The code below is simplified from my real codebase at work, where the
K> rb_sys_fail() means the server crashes, without possibility of recovery.

 The problem is that appendline() use ferror() when rb_sys_fail() use
 errno. On linux I have

   These  functions  should  not fail and do not set the external variable
                                          ^^^^^^^^^^
   errno.  (However, in case fileno detects that its  argument  is  not  a
   valid stream, it must return -1 and set errno to EBADF.)



Guy Decoux