From f2909995284986b8cb4222d1c3b8520a80747e6a Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sat, 14 Jun 1997 19:13:55 +0000 Subject: [PATCH] Use 'STDIN_FILENO' and `STDOUT_FILENO' instead of `sp'. OSF's libc isn't quite prepared to have two different FILEs refer to the same file descriptor. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1906 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/popper/pop_init.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/appl/popper/pop_init.c b/appl/popper/pop_init.c index ae28a7fef..3a6ac4693 100644 --- a/appl/popper/pop_init.c +++ b/appl/popper/pop_init.c @@ -64,7 +64,6 @@ pop_init(POP *p,int argcount,char **argmessage) int c; int len; int options = 0; - int sp = 0; /* Socket pointer */ char * trace_file_name = "/tmp/popper-trace"; int inetd = 0; int portnum = 0; @@ -161,7 +160,7 @@ pop_init(POP *p,int argcount,char **argmessage) /* Get the address and socket of the client to whom I am speaking */ len = sizeof(cs); - if (getpeername(sp,(struct sockaddr *)&cs,&len) < 0){ + if (getpeername(STDIN_FILENO, (struct sockaddr *)&cs, &len) < 0){ pop_log(p,POP_PRIORITY, "Unable to obtain socket and address of client, err = %d",errno); exit (1); @@ -220,14 +219,14 @@ pop_init(POP *p,int argcount,char **argmessage) } /* Create input file stream for TCP/IP communication */ - if ((p->input = fdopen(sp,"r")) == NULL){ + if ((p->input = fdopen(STDIN_FILENO,"r")) == NULL){ pop_log(p,POP_PRIORITY, "Unable to open communication stream for input, err = %d",errno); exit (1); } /* Create output file stream for TCP/IP communication */ - if ((p->output = fdopen(sp,"w")) == NULL){ + if ((p->output = fdopen(STDOUT_FILENO,"w")) == NULL){ pop_log(p,POP_PRIORITY, "Unable to open communication stream for output, err = %d",errno); exit (1);