]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/ppp/ppp-2.4.1/pppd-resolv-varrun.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / ppp / ppp-2.4.1 / pppd-resolv-varrun.patch
1 --- ppp/pppd/ipcp.c     2001-03-08 18:11:12.000000000 +1300
2 +++ ppp/pppd/ipcp.c     2005-02-06 14:10:13.055551720 +1300
3 @@ -32,6 +32,8 @@
4  #include <sys/socket.h>
5  #include <netinet/in.h>
6  #include <arpa/inet.h>
7 +#include <sys/stat.h>
8 +#include <unistd.h>
9  
10  #include "pppd.h"
11  #include "fsm.h"
12 @@ -1859,6 +1861,14 @@
13      u_int32_t peerdns1, peerdns2;
14  {
15      FILE *f;
16 +    struct stat dirinfo;
17 +
18 +    if(stat(_PATH_OUTDIR, &dirinfo)) {
19 +        if(mkdir(_PATH_OUTDIR, 0775)) {
20 +            error("Failed to create directory %s: %m", _PATH_OUTDIR);
21 +            return;
22 +        }
23 +    }
24  
25      f = fopen(_PATH_RESOLV, "w");
26      if (f == NULL) {
27 --- ppp/pppd/pathnames.h        2001-03-08 18:15:37.000000000 +1300
28 +++ ppp/pppd/pathnames.h        2005-02-06 14:01:19.423676096 +1300
29 @@ -28,7 +28,8 @@
30  #define _PATH_TTYOPT    _ROOT_PATH "/etc/ppp/options."
31  #define _PATH_CONNERRS  _ROOT_PATH "/etc/ppp/connect-errors"
32  #define _PATH_PEERFILES         _ROOT_PATH "/etc/ppp/peers/"
33 -#define _PATH_RESOLV    _ROOT_PATH "/etc/ppp/resolv.conf"
34 +#define _PATH_OUTDIR   _ROOT_PATH _PATH_VARRUN "/ppp"
35 +#define _PATH_RESOLV   _PATH_OUTDIR "/resolv.conf"
36  
37  #define _PATH_USEROPT   ".ppprc"
38