From: Martin Wilck Subject: [PATCH v2 3/9] mpathpersist: no need to treat error close() as fatal Date: Mon, 27 May 2019 14:59:36 +0200 Message-ID: <20190527125942.8366-4-mwilck@suse.com> References: <20190527125942.8366-1-mwilck@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190527125942.8366-1-mwilck@suse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: Christophe Varoqui , Benjamin Marzinski Cc: dm-devel@redhat.com, Xose Vazquez Perez , Martin Wilck List-Id: dm-devel.ids Simplify code a bit. Signed-off-by: Martin Wilck --- 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