summaryrefslogtreecommitdiff
path: root/iscsiuio
diff options
context:
space:
mode:
authorLee Duncan <lduncan@suse.com>2019-05-14 10:47:59 -0700
committerLee Duncan <lduncan@suse.com>2019-05-14 10:47:59 -0700
commit1aa16e914eec3c97210a93dfab25b194e56a8298 (patch)
treed1dcc46bf9d04a61944b711623cb9e09b5aa388d /iscsiuio
parent9483ee87ceea3ec8816e6a39d93aee242e7e19d2 (diff)
downloadopen-iscsi-1aa16e914eec3c97210a93dfab25b194e56a8298.tar.gz
Fix pipe notification code
Only send a message down the pipe if it is open, i.e. only in daemon (non-foreground) mode. Fixes: 9483ee87ceea3ec8816e6a39d93aee242e7e19d2
Diffstat (limited to 'iscsiuio')
-rw-r--r--iscsiuio/src/unix/main.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/iscsiuio/src/unix/main.c b/iscsiuio/src/unix/main.c
index 5106ebe..dd7df4d 100644
--- a/iscsiuio/src/unix/main.c
+++ b/iscsiuio/src/unix/main.c
@@ -409,10 +409,12 @@ int main(int argc, char *argv[])
if (rc != 0)
goto error;
- /* signal parent they can go away now */
- close(pipefds[0]);
- write(pipefds[1], "ok\n", 3);
- close(pipefds[1]);
+ if (!foreground) {
+ /* signal parent they can go away now */
+ close(pipefds[0]);
+ write(pipefds[1], "ok\n", 3);
+ close(pipefds[1]);
+ }
/* NetLink connection to listen to NETLINK_ISCSI private messages */
if (nic_nl_open() != 0)