[llvm-commits] [llvm] r112844 - /llvm/trunk/lib/System/Unix/Path.inc

Dan Gohman gohman at apple.com
Thu Sep 2 11:24:46 PDT 2010


Author: djg
Date: Thu Sep  2 13:24:46 2010
New Revision: 112844

URL: http://llvm.org/viewvc/llvm-project?rev=112844&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/System/Unix/Path.inc

Modified: llvm/trunk/lib/System/Unix/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Path.inc?rev=112844&r1=112843&r2=112844&view=diff
==============================================================================
--- llvm/trunk/lib/System/Unix/Path.inc (original)
+++ llvm/trunk/lib/System/Unix/Path.inc Thu Sep  2 13:24:46 2010
@@ -282,14 +282,14 @@
   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 @@
     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)





More information about the llvm-commits mailing list