blob: 4d9e99d6be1eef1bd25faf9e248e528452031050 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
/* ISC license. */
#include <sys/types.h>
#include <errno.h>
#include <skalibs/allreadwrite.h>
#include <skalibs/error.h>
ssize_t unsanitize_read (ssize_t r)
{
return r == -1 ? errno == EPIPE ? (errno = 0, 0) : -1 :
!r ? (errno = EWOULDBLOCK, -1) : r ;
}
|