summaryrefslogtreecommitdiff
path: root/chat/mu-conference/patches/patch-aa
blob: 782e576349663dc95a4b94cdcb0a81796438e319 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
$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);