diff options
author | epochqwert <epoch@hacking.allowed.org> | 2015-06-07 01:17:46 -0500 |
---|---|---|
committer | epochqwert <epoch@hacking.allowed.org> | 2015-06-07 01:17:46 -0500 |
commit | 985da79c2cb6961f54bf13abdb7758ec67d710b0 (patch) | |
tree | 683f14f07688c1ed975e7550647e7ffe1ed01fe0 | |
parent | c049efe694535574770634b5ae40230c59098082 (diff) | |
download | libirc-985da79c2cb6961f54bf13abdb7758ec67d710b0.tar.gz libirc-985da79c2cb6961f54bf13abdb7758ec67d710b0.zip |
fileno(stdios) instead of 0 and 1 used in dup2()s. thx duper.
-rw-r--r-- | libirc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |