patch for SIGPIPE in tds_write_packet

Mark Schaal mark at champ.tstonramp.com
Tue Jan 25 15:16:04 EST 2000


> 
> So for some reason, when MS SQL disconnects you get a SIGPIPE signal when
> trying to write to the fd, whereas with Sybase this doesn't happen.
> 
> Anyway, this code seems to fix that, I'm not sure if we'd need to put a
> SIGPIPE check around the read (do you get bad pipe or does it just return
> EIO, EBADF or EINVAL??).

That type of information is usually available in the man pages.

    "If a read() is interrupted by a signal before it  reads  any
     data, it will return -1 with errno set to EINTR.

     If a read() is interrupted by a signal after it has success-
     fully  read  some  data,  it will return the number of bytes
     read."

> 
> There will probably be more places to add in checks for tds->s.
> 
> And I have yet another gripe with gdb. For some reason it crashes when I try
> any signal handling at all. Joy. I guess I ought to upgrade gdb... ;-)
> 
> Geoff


Mark
-- 
Mark J. Schaal					Phone:      (909) 620-7724
TST On Ramp					Fax:	    (909) 620-8174
System Administrator				E-Mail: mark at tstonramp.com



More information about the FreeTDS mailing list