cornucopia: bump SRCREV
[openembedded.git] / recipes / ppp / ppp-2.4.4 / pppd-resolv-varrun.patch
blobc22d8cc085896abafb6480f6e608cea05d0743e9
3 # Patch managed by http://www.holgerschurig.de/patcher.html
6 --- ppp-2.4.3/pppd/ipcp.c~pppd-resolv-varrun.patch
7 +++ ppp-2.4.3/pppd/ipcp.c
8 @@ -55,6 +55,8 @@
9 #include <sys/socket.h>
10 #include <netinet/in.h>
11 #include <arpa/inet.h>
12 +#include <sys/stat.h>
13 +#include <unistd.h>
15 #include "pppd.h"
16 #include "fsm.h"
17 @@ -2032,6 +2034,14 @@
18 u_int32_t peerdns1, peerdns2;
20 FILE *f;
21 + struct stat dirinfo;
23 + if(stat(_PATH_OUTDIR, &dirinfo)) {
24 + if(mkdir(_PATH_OUTDIR, 0775)) {
25 + error("Failed to create directory %s: %m", _PATH_OUTDIR);
26 + return;
27 + }
28 + }
30 f = fopen(_PATH_RESOLV, "w");
31 if (f == NULL) {
32 --- ppp-2.4.3/pppd/pathnames.h~pppd-resolv-varrun.patch
33 +++ ppp-2.4.3/pppd/pathnames.h
34 @@ -29,7 +29,8 @@
35 #define _PATH_TTYOPT _ROOT_PATH "/etc/ppp/options."
36 #define _PATH_CONNERRS _ROOT_PATH "/etc/ppp/connect-errors"
37 #define _PATH_PEERFILES _ROOT_PATH "/etc/ppp/peers/"
38 -#define _PATH_RESOLV _ROOT_PATH "/etc/ppp/resolv.conf"
39 +#define _PATH_OUTDIR _ROOT_PATH _PATH_VARRUN "/ppp"
40 +#define _PATH_RESOLV _PATH_OUTDIR "/resolv.conf"
42 #define _PATH_USEROPT ".ppprc"
43 #define _PATH_PSEUDONYM ".ppp_pseudonym"