diff options
author | Petr Uzel | 2011-02-04 09:05:58 +0100 |
---|---|---|
committer | Karel Zak | 2011-02-08 15:43:38 +0100 |
commit | 0239ac01b060ae3246aca463861f79681d275dcc (patch) | |
tree | c8ef0eb7af301b894e89d75d7f5cbb7b7bdc9537 /misc-utils/wipefs.c | |
parent | swapon: use EXIT_SUCCESS constants (diff) | |
download | kernel-qcow2-util-linux-0239ac01b060ae3246aca463861f79681d275dcc.tar.gz kernel-qcow2-util-linux-0239ac01b060ae3246aca463861f79681d275dcc.tar.xz kernel-qcow2-util-linux-0239ac01b060ae3246aca463861f79681d275dcc.zip |
wipefs: use write_all from include/writeall.h
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
Diffstat (limited to 'misc-utils/wipefs.c')
-rw-r--r-- | misc-utils/wipefs.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/misc-utils/wipefs.c b/misc-utils/wipefs.c index 4ab361597..079a9bccf 100644 --- a/misc-utils/wipefs.c +++ b/misc-utils/wipefs.c @@ -36,6 +36,7 @@ #include "nls.h" #include "xalloc.h" #include "strutils.h" +#include "writeall.h" struct wipe_desc { loff_t offset; /* magic string offset */ @@ -213,24 +214,6 @@ read_offsets(struct wipe_desc *wp, const char *fname, int zap) } static int -write_all(int fd, const void *buf, size_t count) -{ - while(count) { - ssize_t tmp; - - errno = 0; - tmp = write(fd, buf, count); - if (tmp > 0) { - count -= tmp; - if (count) - buf += tmp; - } else if (errno != EINTR && errno != EAGAIN) - return -1; - } - return 0; -} - -static int do_wipe_offset(int fd, struct wipe_desc *wp, const char *fname, int noact) { char buf[BUFSIZ]; |