]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
wipefs: use write_all from include/writeall.h
authorPetr Uzel <petr.uzel@suse.cz>
Fri, 4 Feb 2011 08:05:58 +0000 (09:05 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 8 Feb 2011 14:43:38 +0000 (15:43 +0100)
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
misc-utils/wipefs.c

index 4ab361597f25e0cf2c47237a97b6fdf2fb783bfe..079a9bccfa241a2656d276a664939a269cbfaeb8 100644 (file)
@@ -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 */
@@ -212,24 +213,6 @@ read_offsets(struct wipe_desc *wp, const char *fname, int zap)
        return wp;
 }
 
-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)
 {