home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Photo CD Demo 1
/
Demo.bin
/
inetray
/
inetrypn.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-06-04
|
1KB
|
59 lines
/*======================================================================
I N E T R A Y . P I N G . C
doc: Thu Mar 5 12:55:31 1992
dlm: Fri Jun 5 12:46:38 1992
(c) 1992 ant@julia
uE-Info: 51 0 T 0 0 72 2 2 8 ofnI
======================================================================*/
#include <stdio.h>
#include <signal.h>
#include <ctype.h>
#include <sys/param.h>
#include <rpc/rpc.h>
#include "inetray.h"
#include "common.h"
#include "comm.h"
#include "version.h"
#include "patchlevel.h"
int key = 0; /* dummy key */
static void cleanUp() /* clean up self */
{
int i;
for (i=SIGHUP; i<=SIGQUIT; i++)
signal(i,SIG_IGN);
terminateAll();
closeAll();
exit(0);
}
main(ac,av)
int ac; char *av[];
{
int i;
char hName[MAXHOSTNAMELEN],cwd[MAXPATHLEN];
char *getwd();
if (gethostname(hName,MAXHOSTNAMELEN) < 0) {
perror("gethostname");
exit(1);
}
for (i=SIGHUP; i<=SIGQUIT; i++)
signal(i,cleanUp);
fprintf(stderr,"%s [%s%d]\n",av[0],VERSION,PATCHLEVEL);
if (ac == 1) readRc();
else addUseList(ac,av);
fprintf(stderr,"Pinging... [");
registerSvc(hName,"",getwd(cwd));
if (nRunning == 0) fprintf(stderr,"\n[Warning: ");
else fprintf(stderr,"\n[");
fprintf(stderr,"%d workers answered]\n",nRunning);
cleanUp();
}