#define nint, exp10 for non-SUN environs, replace usleep() with closest sleep(), #ifdef sun where appropriate
This commit is contained in:
@@ -68,6 +68,8 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include <sys/resource.h>
|
||||
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
@@ -223,7 +225,7 @@ int portNum; /* I port number for server */
|
||||
printf("null message from server\n");
|
||||
}
|
||||
}
|
||||
usleep(100000);
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
cmdclTaskWrapup:
|
||||
@@ -285,7 +287,14 @@ char *buf;
|
||||
int fdSetWidth; /* width of select bit mask */
|
||||
struct timeval fdSetTimeout;/* timeout interval for select */
|
||||
|
||||
struct rlimit rlp;
|
||||
|
||||
/* MDA - replace obsolete system call
|
||||
fdSetWidth = getdtablesize();
|
||||
*/
|
||||
getrlimit(RLIMIT_NOFILE,&rlp);
|
||||
fdSetWidth = rlp.rlim_cur;
|
||||
|
||||
fdSetTimeout.tv_sec = 0;
|
||||
fdSetTimeout.tv_usec = 0;
|
||||
FD_ZERO(&fdSet);
|
||||
|
||||
@@ -238,7 +238,10 @@ char *argv[]; /* command line args */
|
||||
fflush(stdout); /* flushes needed for socket I/O */
|
||||
fflush(stderr);
|
||||
fflush(pglZzzCxCmd->dataOut);
|
||||
sleep(1);
|
||||
/* MDA - usleep isn't POSIX
|
||||
usleep(100000); /* sleep .1 second */
|
||||
*/
|
||||
}
|
||||
|
||||
return OK;
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#ifndef sun
|
||||
|
||||
#else
|
||||
/* @(#)guiSubr.c 1.10 11/12/92
|
||||
* Author: Roger A. Cole
|
||||
* Date: 02-08-91
|
||||
@@ -3439,3 +3442,5 @@ void *callbackArg; /* I argument to pass to callback function */
|
||||
(int)(fmod(seconds, 1.)*1000000.);
|
||||
notify_set_itimer_func(callbackArg, callbackFn, ITIMER_REAL, &t, NULL);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5984,7 +5984,10 @@ int seconds; /* I number of seconds (added to usec) to sleep */
|
||||
int usec; /* I number of micro-sec (added to sec) to sleep */
|
||||
{
|
||||
#ifndef vxWorks
|
||||
/* MDA - usleep isn't POSIX
|
||||
usleep((unsigned)(seconds*1000000 + usec));
|
||||
*/
|
||||
sleep((unsigned int)seconds);
|
||||
#else
|
||||
int ticks;
|
||||
static int ticksPerSec=0;
|
||||
|
||||
@@ -78,6 +78,18 @@ extern struct ca_static *ca_static;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* nint, exp10 aren't ANSI-C or POSIX */
|
||||
# ifndef sun
|
||||
# ifndef nint
|
||||
# define nint(value) (value>=0 ? (int)((value)+.5) : (int)((value)-.5))
|
||||
# endif
|
||||
# ifndef exp10
|
||||
# define exp10(value) (exp(value * log(10.)))
|
||||
# endif
|
||||
# endif
|
||||
|
||||
|
||||
#define FLD_DIM 20
|
||||
static int nFld;
|
||||
static char *(fields[FLD_DIM]);
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#ifndef sun
|
||||
#else
|
||||
/* @(#)sydPlot.c 1.10 2/23/93
|
||||
* Author: Roger A. Cole
|
||||
* Date: 12-04-90
|
||||
@@ -4069,3 +4071,4 @@ SYD_PL_MSTR *pMstr; /* I pointer to master plot structure */
|
||||
pSlave = pSlave->pNext;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user