]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib,path: use write_all()
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Fri, 16 Sep 2011 08:28:43 +0000 (10:28 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 27 Sep 2011 11:37:41 +0000 (13:37 +0200)
From: Heiko Carstens <heiko.carstens@de.ibm.com>

Since write() doesn't necessarily write the complete buffer with
one call we better use write_all() which takes care of this.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
lib/path.c

index e2bb398026892105b846a51d97a5278703226404..54b8942f45e8a7fcc334894122add11e5d6d432a 100644 (file)
@@ -27,6 +27,7 @@
 #include <stdio.h>
 #include <errno.h>
 
+#include "writeall.h"
 #include "cpuset.h"
 #include "path.h"
 #include "nls.h"
@@ -132,7 +133,7 @@ path_writestr(const char *str, const char *path, ...)
        va_start(ap, path);
        fd = path_vopen(O_WRONLY, path, ap);
        va_end(ap);
-       result = write(fd, str, strlen(str));
+       result = write_all(fd, str, strlen(str));
        close(fd);
        return result;
 }