/*
- * Sherlock Library -- Careful Read/Write
+ * UCW Library -- Careful Read/Write
*
* (c) 2004 Martin Mares <mj@ucw.cz>
*
}
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;