-/* $Log: secnet.c,v $
- * Revision 1.1 1996/03/13 22:27:41 sde1000
- * Initial revision
- *
- */
-
extern char version[];
#include "secnet.h"
if (gettimeofday(&tv_now, NULL)!=0) {
fatal_perror("main loop: gettimeofday");
}
- now=(tv_now.tv_sec*1000)+(tv_now.tv_usec/1000);
+ now=((uint64_t)tv_now.tv_sec*(uint64_t)1000)+
+ ((uint64_t)tv_now.tv_usec/(uint64_t)1000);
idx=0;
for (i=reg; i; i=i->next) {
i->after(i->state, fds+idx, i->nfds, &tv_now, &now);
/* Child process - all done, just carry on */
if (pf) fclose(pf);
/* Close stdin, stdout and stderr; we don't need them any more */
+ /* XXX we must leave stderr pointing to something useful -
+ a pipe to a log destination, for example, or just leave
+ it alone. */
close(0);
close(1);
- close(2);
+ /* XXX close(2); */
secnet_is_daemon=True;
+ setsid();
} else {
/* Error */
fatal_perror("cannot fork");