diff options
author | Heiko Carstens | 2011-09-16 10:28:43 +0200 |
---|---|---|
committer | Karel Zak | 2011-09-27 13:37:41 +0200 |
commit | 25dea0b56595d04d9ef9e1eb554b9047ef12dedd (patch) | |
tree | 83d84d827e15df83bd955e7e10c9b304e16bd5d1 | |
parent | chcpu: convert to use lib/path.c (diff) | |
download | kernel-qcow2-util-linux-25dea0b56595d04d9ef9e1eb554b9047ef12dedd.tar.gz kernel-qcow2-util-linux-25dea0b56595d04d9ef9e1eb554b9047ef12dedd.tar.xz kernel-qcow2-util-linux-25dea0b56595d04d9ef9e1eb554b9047ef12dedd.zip |
lib,path: use write_all()
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>
-rw-r--r-- | lib/path.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/path.c b/lib/path.c index e2bb39802..54b8942f4 100644 --- a/lib/path.c +++ b/lib/path.c @@ -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; } |