5a764ab9b2101e52af866a5b20476f0b278f8feb
[openwrt/openwrt.git] / package / network / services / ppp / patches / 103-debian_fix_link_pidfile.patch
1 pppd: Fix creation of linkpidfile
2
3 When pppd is run without "nodetach" or with "updetach", the linkpidfile is
4 never created. The call to create_linkpidfile() is protected by a check for
5 linkpidfile[0] but this is only filled in when create_linkpidfile() is called.
6
7 This patch changes to code to allways uncondiationally call
8 create_linkpidfile(), it originated from the Debian project.
9
10 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
11
12 --- a/pppd/main.c
13 +++ b/pppd/main.c
14 @@ -780,8 +780,7 @@ detach()
15 /* update pid files if they have been written already */
16 if (pidfilename[0])
17 create_pidfile(pid);
18 - if (linkpidfile[0])
19 - create_linkpidfile(pid);
20 + create_linkpidfile(pid);
21 exit(0); /* parent dies */
22 }
23 setsid();