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>
This commit is contained in:
parent
9bc2b4b185
commit
25dea0b565
1 changed files with 2 additions and 1 deletions
|
@ -27,6 +27,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include "writeall.h"
|
||||||
#include "cpuset.h"
|
#include "cpuset.h"
|
||||||
#include "path.h"
|
#include "path.h"
|
||||||
#include "nls.h"
|
#include "nls.h"
|
||||||
|
@ -132,7 +133,7 @@ path_writestr(const char *str, const char *path, ...)
|
||||||
va_start(ap, path);
|
va_start(ap, path);
|
||||||
fd = path_vopen(O_WRONLY, path, ap);
|
fd = path_vopen(O_WRONLY, path, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
result = write(fd, str, strlen(str));
|
result = write_all(fd, str, strlen(str));
|
||||||
close(fd);
|
close(fd);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue