From 985da79c2cb6961f54bf13abdb7758ec67d710b0 Mon Sep 17 00:00:00 2001 From: epochqwert Date: Sun, 7 Jun 2015 01:17:46 -0500 Subject: fileno(stdios) instead of 0 and 1 used in dup2()s. thx duper. --- libirc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libirc.c b/libirc.c index a69e020..05a682f 100644 --- a/libirc.c +++ b/libirc.c @@ -40,8 +40,8 @@ int serverConnect(char *serv,char *port) { name[2]=0; socketpair(PF_LOCAL,SOCK_STREAM,0,s); if(!(pid=fork())) { - dup2(s[1],0); - dup2(s[1],1); + dup2(s[1],fileno(stdin)); + dup2(s[1],fileno(stdout)); execv(name[0],name); } if(pid == -1) return -1; -- cgit v1.2.3