ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/netproc.c
(Generate patch)

Comparing ray/src/util/netproc.c (file contents):
Revision 2.6 by gregl, Thu Sep 18 16:10:19 1997 UTC vs.
Revision 2.10 by greg, Wed Apr 23 00:52:34 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1996 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Parallel network process handling routines
6   */
7  
8   #include <stdio.h>
12 #include <sys/types.h>
13 #include <sys/select.h>
9   #include <signal.h>
10   #include <fcntl.h>
11 + #include "selcall.h"
12   #include "netproc.h"
13   #include "paths.h"
14   #include "vfork.h"
19                                        /* select call compatibility stuff */
20 #ifndef FD_SETSIZE
21 #include <sys/param.h>
22 #define FD_SETSIZE      NOFILE          /* maximum # select file descriptors */
23 #endif
24 #ifndef FD_SET
25 #ifndef NFDBITS
26 #define NFDBITS         (8*sizeof(int)) /* number of bits per fd_mask */
27 #endif
28 #define FD_SET(n, p)    ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
29 #define FD_CLR(n, p)    ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
30 #define FD_ISSET(n, p)  ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
31 #ifndef BSD
32 #define bzero(d,n)      (void)memset(d,0,n)
33 #endif
34 #define FD_ZERO(p)      bzero((char *)(p), sizeof(*(p)))
35 #endif
15  
16   PSERVER *pslist = NULL;         /* global process server list */
17  
# Line 48 | Line 27 | static int     maxfd;          /* maximum assigned descriptor */
27  
28   extern char     *remsh;         /* externally defined remote shell program */
29  
51 extern char     *malloc(), *realloc();
30   extern char     *getenv();
31  
32  
# Line 144 | Line 122 | PSERVER        *ps;
122                                          /* remove server from list */
123          psp->next = ps->next;
124          pslist = pstart.next;
125 <        free((char *)ps);               /* free associated memory */
125 >        free((void *)ps);               /* free associated memory */
126   }
127  
128  
# Line 267 | Line 245 | int    fd;
245          if (pp->elen == 0)
246                  pp->errs = (char *)malloc(nr+1);
247          else
248 <                pp->errs = (char *)realloc(pp->errs, pp->elen+nr+1);
248 >                pp->errs = (char *)realloc((void *)pp->errs, pp->elen+nr+1);
249          if (pp->errs == NULL) {
250                  perror("malloc failed");
251                  exit(1);
# Line 314 | Line 292 | int    status;
292          close(pp->efd);                         /* close error stream */
293          pindex[pp->efd] = NULL;
294          FD_CLR(pp->efd, &errdesc);
295 <        free((char *)pp->errs);
295 >        free((void *)pp->errs);
296          pp->com = NULL;                         /* clear settings */
297          pp->pid = -1;
298          pp->efd = -1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines