X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fcarefulio.c;h=b8d865d43a551bc13cf7f4fae068e8409bee60af;hb=e371dcc1cd2857036374dd9597705faed0427006;hp=7bfeee9b80e8c47aa4d49c983e8f15517df6b9f6;hpb=c0a2cdadcbdb1d5331efb149b9ef473e2bbdcbec;p=libucw.git diff --git a/lib/carefulio.c b/lib/carefulio.c index 7bfeee9b..b8d865d4 100644 --- a/lib/carefulio.c +++ b/lib/carefulio.c @@ -1,5 +1,5 @@ /* - * Sherlock Library -- Careful Read/Write + * UCW Library -- Careful Read/Write * * (c) 2004 Martin Mares * @@ -34,13 +34,13 @@ careful_read(int fd, void *buf, int len) } int -careful_write(int fd, void *buf, int len) +careful_write(int fd, const void *buf, int len) { - byte *pos = buf; + const byte *pos = buf; while (len) { int l = write(fd, pos, len); - if (l <= 0) + if (l < 0) return -1; if (!l) return 0;