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

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