30 lines
549 B
Diff
30 lines
549 B
Diff
Subject: [PATCH] check close return value
|
|
|
|
---
|
|
mpathpersist/main.c | 9 ++++++++-
|
|
1 file changed, 8 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/mpathpersist/main.c b/mpathpersist/main.c
|
|
index 4db07b2..db8b6d7 100644
|
|
--- a/mpathpersist/main.c
|
|
+++ b/mpathpersist/main.c
|
|
@@ -498,7 +498,14 @@ int main (int argc, char * argv[])
|
|
|
|
out :
|
|
if (fd >= 0)
|
|
- close(fd);
|
|
+ {
|
|
+ res = close(fd);
|
|
+ if (res < 0)
|
|
+ {
|
|
+ ret = MPATH_PR_FILE_ERROR;
|
|
+ }
|
|
+
|
|
+ }
|
|
mpath_lib_exit(conf);
|
|
udev_unref(udev);
|
|
return (ret >= 0) ? ret : MPATH_PR_OTHER;
|
|
--
|
|
2.19.1
|
|
|