From cb32f0141ead382a972f86f144b9500f2414166f Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Pavl=C3=ADn?= Date: Fri, 21 Sep 2012 13:51:45 +0200 Subject: [PATCH] udev: check return value of write --- src/udev/collect/collect.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/udev/collect/collect.c b/src/udev/collect/collect.c index 47c2ddd..feae4bb 100644 --- a/src/udev/collect/collect.c +++ b/src/udev/collect/collect.c @@ -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; + } } } -- 2.7.4