Blob Blame Raw
From 134f8dcbcdd76bf2418c64de1b4e3dca6163773d Mon Sep 17 00:00:00 2001
From: Duane Northcutt <jduanen@yahoo.com>
Date: Wed, 14 May 2014 11:23:23 -0700
Subject: [PATCH] iscsid: Fix double close of mgmt ipc fd

Ran into a problem where iscsiadm was closing an already closed fd
(returning EBADF. Seems like the close() in line 466 is redundant as
it is done in mgmt_ipc_destroy_queue_task(). Could also assign
qtask->mgmt_ipc_fd to NULL, but it seems better to do it this way.
---
 usr/mgmt_ipc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/usr/mgmt_ipc.c b/usr/mgmt_ipc.c
index a82c063..ee037d9 100644
--- a/usr/mgmt_ipc.c
+++ b/usr/mgmt_ipc.c
@@ -463,7 +463,6 @@ mgmt_ipc_write_rsp(queue_task_t *qtask, int err)
 	qtask->rsp.err = err;
 	if (write(qtask->mgmt_ipc_fd, &qtask->rsp, sizeof(qtask->rsp)) < 0)
 		log_error("IPC qtask write failed: %s", strerror(errno));
-	close(qtask->mgmt_ipc_fd);
 	mgmt_ipc_destroy_queue_task(qtask);
 }
 
-- 
1.9.3