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