aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorepochqwert <epoch@hacking.allowed.org>2015-06-07 01:17:46 -0500
committerepochqwert <epoch@hacking.allowed.org>2015-06-07 01:17:46 -0500
commit985da79c2cb6961f54bf13abdb7758ec67d710b0 (patch)
tree683f14f07688c1ed975e7550647e7ffe1ed01fe0
parentc049efe694535574770634b5ae40230c59098082 (diff)
downloadlibirc-985da79c2cb6961f54bf13abdb7758ec67d710b0.tar.gz
libirc-985da79c2cb6961f54bf13abdb7758ec67d710b0.zip
fileno(stdios) instead of 0 and 1 used in dup2()s. thx duper.
-rw-r--r--libirc.c4
1 files 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;