[dm-devel] [PATCH v2 3/9] mpathpersist: no need to treat error close() as fatal
Martin Wilck
mwilck at suse.com
Mon May 27 12:59:36 UTC 2019
Simplify code a bit.
Signed-off-by: Martin Wilck <mwilck at suse.com>
---
mpathpersist/main.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/mpathpersist/main.c b/mpathpersist/main.c
index 2e19f29f..6df9762d 100644
--- a/mpathpersist/main.c
+++ b/mpathpersist/main.c
@@ -154,7 +154,7 @@ static int do_batch_file(const char *batch_fn)
static int handle_args(int argc, char * argv[], int nline)
{
- int fd, c, res;
+ int fd, c;
const char *device_name = NULL;
int num_prin_sa = 0;
int num_prout_sa = 0;
@@ -179,7 +179,6 @@ static int handle_args(int argc, char * argv[], int nline)
char *batch_fn = NULL;
void *resp = NULL;
struct transportid * tmp;
- struct config *conf = multipath_conf;
memset(transportids, 0, MPATH_MX_TIDS * sizeof(struct transportid));
@@ -565,13 +564,7 @@ static int handle_args(int argc, char * argv[], int nline)
printf("PR out: command failed\n");
}
- res = close (fd);
- if (res < 0)
- {
- mpath_lib_exit(conf);
- udev_unref(udev);
- return MPATH_PR_FILE_ERROR;
- }
+ close (fd);
out :
if (ret == MPATH_PR_SYNTAX_ERROR) {
--
2.21.0
More information about the dm-devel
mailing list