$NetBSD: patch-aa,v 1.1 2004/07/22 18:02:10 kristerw Exp $ --- src/main.c.orig Thu Jul 22 19:54:54 2004 +++ src/main.c Thu Jul 22 19:55:36 2004 @@ -34,12 +34,12 @@ struct stat st; char *config_file = NULL; pool p; - jcr = (jcr_instance)malloc(sizeof(_jcr_instance)); GThread *dthread; /* the packet delivery thread */ GMainLoop *gmain; /* the receive packet event loop */ + jcr = (jcr_instance)malloc(sizeof(_jcr_instance)); fprintf(stderr, "%s -- %s\n%s\n\n", _JCOMP_NAME, _JCOMP_VERS, _JCOMP_COPY); while ((c = getopt(argc, argv, "Bsd:c:")) != EOF) @@ -119,6 +119,7 @@ if (inBackground == 1) { + int fdlimit, fd; if ((pid = fork()) == -1) { fprintf(stderr, "%s: Could not start in background\n", JDBG); exit(1); @@ -128,8 +129,8 @@ /* in child process .... process and terminal housekeeping */ setsid(); - int fdlimit = sysconf(_SC_OPEN_MAX); - int fd = 0; + fdlimit = sysconf(_SC_OPEN_MAX); + fd = 0; while (fd < fdlimit) close(fd++); open("/dev/null",O_RDWR);