From 079e3779378675c98d17bd04278332edd39dc6e1 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Fri, 8 Nov 1996 22:02:22 +0000 Subject: [PATCH] fixed GNU compile under solaris --- src/util/iocLogServer.c | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/src/util/iocLogServer.c b/src/util/iocLogServer.c index 1b4563729..97aca8187 100644 --- a/src/util/iocLogServer.c +++ b/src/util/iocLogServer.c @@ -47,6 +47,9 @@ * .09 050494 pg HPUX port changes. * .10 021694 joh ANSI C * $Log$ + * Revision 1.22 1996/11/02 02:20:36 jhill + * use osiSock.h + * * Revision 1.21 1996/06/21 01:07:46 jhill * use sigemptyset() and cc -Xc changes * @@ -66,28 +69,29 @@ static char *pSCCSID = "@(#)iocLogServer.c 1.9\t05/05/94"; -#include +#include + +/* + * _XOPEN_SOURCE & _POSIX_C_SOURCE must not be defined + * prior to including the socket headers on solaris + * + * functions involved here: + * popen() stdio.h + * sigaction() signal.h + */ +#define _XOPEN_SOURCE /* for solaris and "cc -Xc"/"gcc -ansi" */ +#define _POSIX_C_SOURCE 3 /* for solaris and "cc -Xc"/"gcc -ansi" */ + #include #include #include - +#include #include #include #include -#include -#include #include - - -#if 0 -/* - * _XOPEN_SOURCE & _POSIX_C_SOURCE must not be defined - * prior to including the socket headers on solaris - */ -#define _XOPEN_SOURCE /* for solaris and "cc -Xc" */ -#define _POSIX_C_SOURCE 3 /* for solaris and "cc -Xc" */ -#endif +#include static unsigned short ioc_log_port; static long ioc_log_file_limit; @@ -416,7 +420,7 @@ static void acceptNewClient(void *pParam) } strncpy(pclient->name, pname, sizeof(pclient->name)); - pclient->name[sizeof(pclient->name) - 1u] = NULL; + pclient->name[sizeof(pclient->name) - 1u] = '\0'; logTime(pclient); @@ -526,7 +530,7 @@ static void readFromClient(void *pParam) } - pclient->ptopofstack[length] = NULL; + pclient->ptopofstack[length] = '\0'; pline = pclient->recvbuf; while(TRUE){ unsigned nchar; @@ -846,7 +850,8 @@ static int getDirectory() /* * Use popen() to execute command and grab output. */ - if ((pipe = popen( ioc_log_file_command, "r")) == NULL) { + pipe = popen(ioc_log_file_command, "r"); + if (pipe == NULL) { fprintf(stderr, "Problem executing `%s' because `%s'\n", ioc_log_file_command,