summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/ppp/ppp-2.4.5/pppd-resolv-varrun.patch
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-09-01 19:09:11 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-09-01 19:09:57 +0100
commitd62ee7eaf2ba025c3f64b2d4e10dc7cec4637612 (patch)
treef36fe3008f36ff75cbdd31b630f8f13f1f205ebb /meta/recipes-connectivity/ppp/ppp-2.4.5/pppd-resolv-varrun.patch
parentcaab7fc509bf27706ff3248689f6afd04225cfda (diff)
downloadopenembedded-core-contrib-d62ee7eaf2ba025c3f64b2d4e10dc7cec4637612.tar.gz
packages: Separate out most of the remaining packages into recipes
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/recipes-connectivity/ppp/ppp-2.4.5/pppd-resolv-varrun.patch')
-rw-r--r--meta/recipes-connectivity/ppp/ppp-2.4.5/pppd-resolv-varrun.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/ppp/ppp-2.4.5/pppd-resolv-varrun.patch b/meta/recipes-connectivity/ppp/ppp-2.4.5/pppd-resolv-varrun.patch
new file mode 100644
index 0000000000..c4e61fdd28
--- /dev/null
+++ b/meta/recipes-connectivity/ppp/ppp-2.4.5/pppd-resolv-varrun.patch
@@ -0,0 +1,43 @@
+The patch comes from OpenEmbedded
+Rebased for ppp-2.4.5. Dongxiao Xu <dongxiao.xu@intel.com>
+
+diff -ruN ppp-2.4.5-orig/pppd/ipcp.c ppp-2.4.5/pppd/ipcp.c
+--- ppp-2.4.5-orig/pppd/ipcp.c 2010-06-30 15:51:12.050166398 +0800
++++ ppp-2.4.5/pppd/ipcp.c 2010-06-30 17:02:33.930393283 +0800
+@@ -55,6 +55,8 @@
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
++#include <sys/stat.h>
++#include <unistd.h>
+
+ #include "pppd.h"
+ #include "fsm.h"
+@@ -2095,6 +2097,14 @@
+ u_int32_t peerdns1, peerdns2;
+ {
+ FILE *f;
++ struct stat dirinfo;
++
++ if(stat(_PATH_OUTDIR, &dirinfo)) {
++ if(mkdir(_PATH_OUTDIR, 0775)) {
++ error("Failed to create directory %s: %m", _PATH_OUTDIR);
++ return;
++ }
++ }
+
+ f = fopen(_PATH_RESOLV, "w");
+ if (f == NULL) {
+diff -ruN ppp-2.4.5-orig/pppd/pathnames.h ppp-2.4.5/pppd/pathnames.h
+--- ppp-2.4.5-orig/pppd/pathnames.h 2010-06-30 15:51:12.043682063 +0800
++++ ppp-2.4.5/pppd/pathnames.h 2010-06-30 17:03:20.594371055 +0800
+@@ -30,7 +30,8 @@
+ #define _PATH_TTYOPT _ROOT_PATH "/etc/ppp/options."
+ #define _PATH_CONNERRS _ROOT_PATH "/etc/ppp/connect-errors"
+ #define _PATH_PEERFILES _ROOT_PATH "/etc/ppp/peers/"
+-#define _PATH_RESOLV _ROOT_PATH "/etc/ppp/resolv.conf"
++#define _PATH_OUTDIR _ROOT_PATH _PATH_VARRUN "/ppp"
++#define _PATH_RESOLV _PATH_OUTDIR "/resolv.conf"
+
+ #define _PATH_USEROPT ".ppprc"
+ #define _PATH_PSEUDONYM ".ppp_pseudonym"