[PATCH] wipefs: use write_all from include/writeall.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Petr Uzel <petr.uzel@xxxxxxx>
---
 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 4ab3615..079a9bc 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];
-- 
1.7.1


Petr

--
Petr Uzel
IRC: ptr_uzl @ freenode

Attachment: pgpJHtIWYLt_u.pgp
Description: PGP signature


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux