Blame SOURCES/0044-RHBZ-976688-fix-wipe-wwids.patch

4728c8
---
4728c8
 libmultipath/wwids.c |    6 ++++++
4728c8
 1 file changed, 6 insertions(+)
4728c8
4728c8
Index: multipath-tools-130222/libmultipath/wwids.c
4728c8
===================================================================
4728c8
--- multipath-tools-130222.orig/libmultipath/wwids.c
4728c8
+++ multipath-tools-130222/libmultipath/wwids.c
4728c8
@@ -4,6 +4,7 @@
4728c8
 #include <string.h>
4728c8
 #include <limits.h>
4728c8
 #include <stdio.h>
4728c8
+#include <sys/types.h>
4728c8
 
4728c8
 #include "checkers.h"
4728c8
 #include "vector.h"
4728c8
@@ -100,6 +101,11 @@ replace_wwids(vector mp)
4728c8
 		condlog(0, "cannot truncate wwids file : %s", strerror(errno));
4728c8
 		goto out_file;
4728c8
 	}
4728c8
+	if (lseek(fd, 0, SEEK_SET) < 0) {
4728c8
+		condlog(0, "cannot seek to the start of the file : %s",
4728c8
+			strerror(errno));
4728c8
+		goto out_file;
4728c8
+	}
4728c8
 	len = strlen(WWIDS_FILE_HEADER);
4728c8
 	if (write_all(fd, WWIDS_FILE_HEADER, len) != len) {
4728c8
 		condlog(0, "Can't write wwid file header : %s",