[PATCH 60/65] channel_open: don't close previous fd here

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sun, 5 Jul 2015 23:08:02 +0200

---
 ii.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/ii.c b/ii.c
index 6a4038d..1699269 100644
--- a/ii.c
+++ b/ii.c
_AT_@ -197,23 +197,16 @@ channel_open(Channel *c)
 {
 	int fd;
 
-	/* in */
+	/* make "in" fifo if it doesn't exist already. */
 	if(access(c->inpath, F_OK) == -1)
 		mkfifo(c->inpath, S_IRWXU);
 	c->fdin = -1;
 	fd = open(c->inpath, O_RDONLY | O_NONBLOCK, 0);
 	if(fd == -1)
-		goto err;
+		return -1;
 	c->fdin = fd;
 
 	return 0;
-err:
-	if(c->fdin > 2) {
-		close(c->fdin);
-		c->fdin = -1;
-	}
-
-	return -1;
 }
 
 static int
_AT_@ -223,7 +216,6 @@ channel_reopen(Channel *c)
 		close(c->fdin);
 		c->fdin = -1;
 	}
-
 	return channel_open(c);
 }
 
-- 
2.4.10
--Multipart=_Mon__9_May_2016_17_21_10_+0200_I.6cpFVydhq75aaE
Content-Type: text/x-diff;
 name="0061-small-cleanup-check-uds-pointer-dont-assign-empty-va.patch"
Content-Disposition: attachment;
 filename="0061-small-cleanup-check-uds-pointer-dont-assign-empty-va.patch"
Content-Transfer-Encoding: 7bit
Received on Mon Sep 17 2001 - 00:00:00 CEST

This archive was generated by hypermail 2.3.0 : Mon May 09 2016 - 17:24:22 CEST