]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
2.3.90-12
authorJakub Jelinek <jakub@redhat.com>
Mon, 12 Sep 2005 14:20:49 +0000 (14:20 +0000)
committerJakub Jelinek <jakub@redhat.com>
Mon, 12 Sep 2005 14:20:49 +0000 (14:20 +0000)
fedora/tzdata-update.c

index 38539817d3159df0064c4fc3f9dcae3f81627e76..7f12322bf4e15740b81fc7628fe060c16df52c1e 100644 (file)
@@ -400,12 +400,18 @@ char zonename[1024];
 ssize_t
 readall (int fd, void *buf, size_t len)
 {
+  INTERNAL_SYSCALL_DECL (err);
   size_t n = len;
   ssize_t ret;
   do
     {
       ret = INTERNAL_SYSCALL (read, err, 3, fd, buf, n);
-      if (ret <= 0)
+      if (INTERNAL_SYSCALL_ERROR_P (ret, err))
+       {
+         ret = -1;
+         break;
+       }
+      else if (ret == 0)
        break;
       buf = (char *) buf + ret;
       n -= ret;
@@ -417,12 +423,18 @@ readall (int fd, void *buf, size_t len)
 ssize_t
 writeall (int fd, const void *buf, size_t len)
 {
+  INTERNAL_SYSCALL_DECL (err);
   size_t n = len;
   ssize_t ret;
   do
     {
       ret = INTERNAL_SYSCALL (write, err, 3, fd, buf, n);
-      if (ret <= 0)
+      if (INTERNAL_SYSCALL_ERROR_P (ret, err))
+       {
+         ret = -1;
+         break;
+       }
+      else if (ret == 0)
        break;
       buf = (const char *) buf + ret;
       n -= ret;