summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System/Unix
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-09-02 18:24:46 +0000
committerDan Gohman <gohman@apple.com>2010-09-02 18:24:46 +0000
commit9e857449de7d901680f9ef3777e95bbdceeda34d (patch)
treeb91b739f89e3535c0592b51bc10dc0ee7f8fc3af /llvm/lib/System/Unix
parenta8c896b704ca567cf1efa6f41fdbe039ccc17a7b (diff)
downloadbcm5719-llvm-9e857449de7d901680f9ef3777e95bbdceeda34d.tar.gz
bcm5719-llvm-9e857449de7d901680f9ef3777e95bbdceeda34d.zip
Apply a patch from Kees van Reeuwijk to add support for Minix.
Minix apparently doesn't like double-slash separators, and there's no apparent need for them here. llvm-svn: 112844
Diffstat (limited to 'llvm/lib/System/Unix')
-rw-r--r--llvm/lib/System/Unix/Path.inc6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/System/Unix/Path.inc b/llvm/lib/System/Unix/Path.inc
index 44cb0081c50..47e4d1ac3c6 100644
--- a/llvm/lib/System/Unix/Path.inc
+++ b/llvm/lib/System/Unix/Path.inc
@@ -282,14 +282,14 @@ Path::GetCurrentDirectory() {
return Path(pathname);
}
-#if defined(__FreeBSD__) || defined (__NetBSD__)
+#if defined(__FreeBSD__) || defined (__NetBSD__) || defined(__minix)
static int
test_dir(char buf[PATH_MAX], char ret[PATH_MAX],
const char *dir, const char *bin)
{
struct stat sb;
- snprintf(buf, PATH_MAX, "%s//%s", dir, bin);
+ snprintf(buf, PATH_MAX, "%s/%s", dir, bin);
if (realpath(buf, ret) == NULL)
return (1);
if (stat(buf, &sb) != 0)
@@ -350,7 +350,7 @@ Path Path::GetMainExecutable(const char *argv0, void *MainAddr) {
if (realpath(exe_path, link_path))
return Path(std::string(link_path));
}
-#elif defined(__FreeBSD__) || defined (__NetBSD__)
+#elif defined(__FreeBSD__) || defined (__NetBSD__) || defined(__minix)
char exe_path[PATH_MAX];
if (getprogpath(exe_path, argv0) != NULL)
OpenPOWER on IntegriCloud