]> mj.ucw.cz Git - libucw.git/blobdiff - lib/carefulio.c
The pkg-config variables have no default value.
[libucw.git] / lib / carefulio.c
index 7bfeee9b80e8c47aa4d49c983e8f15517df6b9f6..b8d865d43a551bc13cf7f4fae068e8409bee60af 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     Sherlock Library -- Careful Read/Write
+ *     UCW Library -- Careful Read/Write
  *
  *     (c) 2004 Martin Mares <mj@ucw.cz>
  *
@@ -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;