summaryrefslogtreecommitdiffstats
path: root/patches/unfs3-0.9.22
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2012-09-18 22:33:35 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2012-09-18 22:34:58 +0200
commita08385d78eb8d87301614c391d33cf6460ad5dc4 (patch)
tree4d18375f5c3f6151f64d14efc8120ec14adbba54 /patches/unfs3-0.9.22
parent4692e9f56388f9583929ac063d42f676573468d0 (diff)
downloadptxdist-a08385d78eb8d87301614c391d33cf6460ad5dc4.tar.gz
ptxdist-a08385d78eb8d87301614c391d33cf6460ad5dc4.tar.xz
host-unfs3: fix patch
call realpath() with the correct path. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'patches/unfs3-0.9.22')
-rw-r--r--patches/unfs3-0.9.22/0001-HACK-use-the-environment-variable-UNFS_BASE-as-root-.patch22
1 files changed, 13 insertions, 9 deletions
diff --git a/patches/unfs3-0.9.22/0001-HACK-use-the-environment-variable-UNFS_BASE-as-root-.patch b/patches/unfs3-0.9.22/0001-HACK-use-the-environment-variable-UNFS_BASE-as-root-.patch
index 58412b9b8..eae37a29c 100644
--- a/patches/unfs3-0.9.22/0001-HACK-use-the-environment-variable-UNFS_BASE-as-root-.patch
+++ b/patches/unfs3-0.9.22/0001-HACK-use-the-environment-variable-UNFS_BASE-as-root-.patch
@@ -6,8 +6,8 @@ Subject: [PATCH] HACK: use the environment variable UNFS_BASE as root
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
backend_unix.h | 3 ++-
- readdir.c | 12 ++++++++++++
- 2 files changed, 14 insertions(+), 1 deletion(-)
+ readdir.c | 16 ++++++++++++++++
+ 2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/backend_unix.h b/backend_unix.h
index 713288d..62dad83 100644
@@ -31,22 +31,26 @@ index 713288d..62dad83 100644
#define backend_rename rename
#define backend_rmdir rmdir
diff --git a/readdir.c b/readdir.c
-index 0e7290c..556ebf9 100644
+index 0e7290c..53b0bfc 100644
--- a/readdir.c
+++ b/readdir.c
-@@ -213,3 +213,15 @@ READDIR3res read_dir(const char *path, cookie3 cookie, cookieverf3 verf,
+@@ -213,3 +213,19 @@ READDIR3res read_dir(const char *path, cookie3 cookie, cookieverf3 verf,
return result;
}
+
+char *realpath_unix(const char *path, char *resolved_path)
+{
-+ int l = 0;
+ char *base = getenv("UNFS_BASE");
++ char *p;
++
+ if (base) {
-+ strcpy(resolved_path, base);
-+ l = strlen(base);
++ p = malloc(strlen(base) + strlen(path) + 1);
++ strcpy(p, base);
++ strcat(p, path);
++ resolved_path = realpath(p, resolved_path);
++ free(p);
++ return resolved_path;
+ }
-+ return realpath(path, resolved_path + l) ? resolved_path : NULL;
++ return realpath(path, resolved_path);
+}
-+