[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/21] relocatable: support UNIXROOT in relocate() on EMX
From: |
KO Myung-Hun |
Subject: |
[PATCH 09/21] relocatable: support UNIXROOT in relocate() on EMX |
Date: |
Sun, 30 Nov 2014 13:20:11 +0900 |
UNIXROOT is used to specify a drive of a root of FHS. So if a path is
started with '/', then it should be translated to "$UNIXROOT/".
* lib/relocatable.c (relocate): Prepend $UNIXROOT to pathname if it is
started with '/' on EMX.
---
lib/relocatable.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/lib/relocatable.c b/lib/relocatable.c
index c48ed1c..7ce0858 100644
--- a/lib/relocatable.c
+++ b/lib/relocatable.c
@@ -534,6 +534,27 @@ relocate (const char *pathname)
}
}
}
+
+#ifdef __EMX__
+ if (pathname && ISSLASH (pathname[0]))
+ {
+ const char *unixroot = getenv ("UNIXROOT");
+
+ if (unixroot && HAS_DEVICE (unixroot) && !unixroot[2])
+ {
+ char *result = (char *) xmalloc (2 + strlen (pathname) + 1);
+#ifdef NO_XMALLOC
+ if (result != NULL)
+#endif
+ {
+ strcpy (result, unixroot);
+ strcpy (result + 2, pathname);
+ return result;
+ }
+ }
+ }
+#endif
+
/* Nothing to relocate. */
return pathname;
}
--
1.8.5.2
- Re: [PATCH 04/21] stdint: typedef gl_intptr_t and gl_uintptr_t correctly on OS/2 kLIBC, (continued)
- [PATCH 05/21] spawn: do not include sched.h on OS/2 kLIBC, KO Myung-Hun, 2014/11/30
- [PATCH 06/21] Fix character encoding aliases for OS/2, KO Myung-Hun, 2014/11/30
- [PATCH 07/21] find_executable: port to EMX, KO Myung-Hun, 2014/11/30
- [PATCH 08/21] get_shared_library_fullname: port to EMX, KO Myung-Hun, 2014/11/30
- [PATCH 09/21] relocatable: support UNIXROOT in relocate() on EMX,
KO Myung-Hun <=
- [PATCH 12/21] pipe_filter_ii_execute: port to OS/2 kLIBC, KO Myung-Hun, 2014/11/30
- [PATCH 10/21] binary-io: put fd in binary mode if it is not a console on EMX, KO Myung-Hun, 2014/11/30
- [PATCH 11/21] pipe-filter-aux: undefine HAVE_SELECT on KLIBC, KO Myung-Hun, 2014/11/30
- [PATCH 14/21] getdtablesize: do not use getrlimit() on OS/2 kLIBC, KO Myung-Hun, 2014/11/30
- [PATCH 13/21] w32spawn: clear SHELL_SPECIAL_CHARS and SHELL_SPACE_CHAR on OS/2 kLIBC, KO Myung-Hun, 2014/11/30