New upstream release:
[debian/iodine.git] / debian / patches / 02_detach.dpatch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 02_detach.dpatch by  <gregor+debian@comodo.priv.at>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: daemonize before chrooting.
6
7 @DPATCH@
8 diff -urNad iodine~/src/iodine.c iodine/src/iodine.c
9 --- iodine~/src/iodine.c        2007-03-30 21:35:42.000000000 +0200
10 +++ iodine/src/iodine.c 2007-11-16 12:20:25.000000000 +0100
11 @@ -564,6 +564,10 @@
12         
13         printf("Sending queries for %s to %s\n", argv[1], argv[0]);
14  
15 +       if (!foreground) {
16 +               do_detach();
17 +       }
18 +
19         do_chroot(newroot);
20         
21         if (username) {
22 @@ -573,10 +577,6 @@
23                 }
24         }
25         
26 -       if (!foreground) {
27 -               do_detach();
28 -       }
29 -
30         tunnel(tun_fd, dns_fd);
31  
32  cleanup2: