instance.c: Defaulting to /proc/curproc/file when locating module on FreeBSD
authorJerome St-Louis <jerome@ecere.com>
Thu, 7 Mar 2013 05:17:34 +0000 (00:17 -0500)
committerJerome St-Louis <jerome@ecere.com>
Thu, 7 Mar 2013 05:17:34 +0000 (00:17 -0500)
ecere/src/com/instance.c

index 9374e91..3389e4d 100644 (file)
@@ -235,7 +235,12 @@ bool Instance_LocateModule(char * name, char * fileName)
    }
    if(!name || !name[0])
    {
-      strcpy(fileName, exeLocation);
+#if !defined(__linux__)
+      if(!access("/proc/curproc/file", F_OK))
+         strcpy(fileName, "/proc/curproc/file");
+      else
+#endif
+         strcpy(fileName, exeLocation);
       return true;
    }
 #endif