]> git.pld-linux.org Git - packages/aiccu.git/blob - 07_allow_tunnels.patch
- cleanup
[packages/aiccu.git] / 07_allow_tunnels.patch
1 commit d7c4f7c0d34b80c188fa45228ca282fd8771a41d
2 Author: Norman Rasmussen <norman@rasmussen.co.za>
3 Date:   Sun Jan 10 21:45:55 2010 +0000
4
5     Allow 'tunnels' mode when there's an already running instance.
6
7 diff --git a/unix-console/main.c b/unix-console/main.c
8 index 8a4d9a9..388d988 100755
9 --- a/unix-console/main.c
10 +++ b/unix-console/main.c
11 @@ -50,7 +50,7 @@ int sigrunning(int sig)
12         /* Close the file again */
13         fclose(f);
14  
15 -       /* If we can HUP it, it still runs */
16 +       /* If we can signal it, it still runs */
17         return (pid > 0 && kill(pid, sig) == 0 ? 1 : 0);
18  }
19  
20 @@ -302,20 +302,6 @@ int main(int argc, char *argv[])
21                 return -1;
22         }
23  
24 -#ifndef _WIN32
25 -       /* start or stop? */
26 -       if (    mode != A_TEST &&
27 -               mode != A_AUTOTEST)
28 -       {
29 -               /* Already running? */
30 -               if (sigrunning(mode == A_STOP ? SIGTERM : 0) == 1)
31 -               {
32 -                       dolog(LOG_ERR, "Already running instance HUP'ed, exiting\n");
33 -                       return 0;
34 -               }
35 -       }
36 -#endif
37 -
38         /* Verify required parameters */
39         if (!g_aiccu->username || !g_aiccu->password)
40         {
41 @@ -331,6 +317,20 @@ int main(int argc, char *argv[])
42                 return ret == 0 ? -1 : 0;
43         }
44  
45 +#ifndef _WIN32
46 +       /* start or stop? */
47 +       if (    mode != A_TEST &&
48 +               mode != A_AUTOTEST)
49 +       {
50 +               /* Already running? */
51 +               if (sigrunning(mode == A_STOP ? SIGTERM : 0) == 1)
52 +               {
53 +                       dolog(LOG_ERR, "Already running instance signaled, exiting\n");
54 +                       return 0;
55 +               }
56 +       }
57 +#endif
58 +
59         /* Get our tunnel */
60         hTunnel = get_tunnel();
61         
This page took 0.044909 seconds and 3 git commands to generate.