chiark / gitweb /
udev: check return value of write
authorVáclav Pavlín <vpavlin@redhat.com>
Fri, 21 Sep 2012 11:51:45 +0000 (13:51 +0200)
committerKay Sievers <kay@vrfy.org>
Sun, 23 Sep 2012 12:24:43 +0000 (14:24 +0200)
src/udev/collect/collect.c

index 47c2ddd..feae4bb 100644 (file)
@@ -305,7 +305,10 @@ static int missing(int fd)
                                 buf = tmpbuf;
                         }
                         snprintf(buf, strlen(him->name)+2, "%s ", him->name);
-                        write(fd, buf, strlen(buf));
+                        if (write(fd, buf, strlen(buf)) < 0) {
+                                free(buf);
+                                return -1;
+                        }
                 }
         }