summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-06-24 17:38:18 -0400
committerJune McEnroe <june@causal.agency>2021-06-25 11:50:14 -0400
commita0cc519829ff7ff5eadc1442439d69fcb87e034a (patch)
treebac9e004e2cfbdcdd4d6fd60d8b93703bebedf63
parentFreeBSD: Enter capabilities mode if restricted (diff)
downloadcatgirl-a0cc519829ff7ff5eadc1442439d69fcb87e034a.tar.gz
catgirl-a0cc519829ff7ff5eadc1442439d69fcb87e034a.zip
Move setting CLOEXEC on socket to ircConnect
Diffstat (limited to '')
-rw-r--r--chat.c1
-rw-r--r--irc.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/chat.c b/chat.c
index 170094f..873eed9 100644
--- a/chat.c
+++ b/chat.c
@@ -338,7 +338,6 @@ int main(int argc, char *argv[]) {
 	signal(SIGTERM, signalHandler);
 	signal(SIGCHLD, signalHandler);
 
-	fcntl(irc, F_SETFD, FD_CLOEXEC);
 	bool pipes = !self.kiosk && !self.restricted;
 	if (pipes) {
 		int error = pipe(utilPipe) || pipe(execPipe);
diff --git a/irc.c b/irc.c
index 41739a3..61d74bb 100644
--- a/irc.c
+++ b/irc.c
@@ -28,6 +28,7 @@
 #include <assert.h>
 #include <err.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <netdb.h>
 #include <netinet/in.h>
 #include <stdarg.h>
@@ -157,6 +158,7 @@ int ircConnect(const char *bindHost, const char *host, const char *port) {
 	if (sock < 0) err(EX_UNAVAILABLE, "%s:%s", host, port);
 	freeaddrinfo(head);
 
+	fcntl(sock, F_SETFD, FD_CLOEXEC);
 	error = tls_connect_socket(client, sock, host);
 	if (error) errx(EX_PROTOCOL, "tls_connect: %s", tls_error(client));
 
title='2019-02-22 23:56:55 -0500'>2019-02-22Move IRC formatting reset to C-sJune McEnroe 2019-02-22Disable terminal flow controlJune McEnroe 2019-02-22Bind up and down arrows to scrollJune McEnroe 2019-02-22Remove topic TODOJune McEnroe 2019-02-22Add /znc commandJune McEnroe 2019-02-22Update status line after scrolling and term eventsJune McEnroe 2019-02-22Reorganize input.cJune McEnroe 2019-02-22Fix name of <raw> window in man pageJune McEnroe 2019-02-22Rename global tags with angle bracketsJune McEnroe 2019-02-22Show status window while connectingJune McEnroe 2019-02-22Reorganize UI code for the umpteenth timeJune McEnroe 2019-02-21Replace "view" with "window"June McEnroe 2019-02-21Remove ROT13June McEnroe 2019-02-21Clean up man pageJune McEnroe 2019-01-26Draw UI before connectingJune McEnroe 2019-01-25Avoid unused variable warnings with getyxJune McEnroe 2019-01-25Add GNU/Linux build instructionsJune McEnroe