diff options
author | Peter Drahoš <drahosp@gmail.com> | 2013-04-01 14:51:35 +0200 |
---|---|---|
committer | Peter Drahoš <drahosp@gmail.com> | 2013-04-01 14:51:35 +0200 |
commit | 96243d79e5509534fa9fc002a209270469cf940a (patch) | |
tree | 785046f43f1e7b086775e5b7c74563e4559f88ed | |
parent | 8a4ca5178da6a90173fd0858a64e4ae3218473c5 (diff) | |
download | lua-96243d79e5509534fa9fc002a209270469cf940a.tar.gz |
Tested on solaris
-rw-r--r-- | src/loadlib_rel.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/loadlib_rel.c b/src/loadlib_rel.c index 25525a9..3182e68 100644 --- a/src/loadlib_rel.c +++ b/src/loadlib_rel.c @@ -123,7 +123,7 @@ static void setprogdir (lua_State *L); #define _PATH_MAX PATH_MAX #endif -#if defined(__linux__) +#if defined(__linux__) || defined(__sun) #include <unistd.h> /* readlink */ #endif @@ -154,7 +154,7 @@ static void setprogdir(lua_State *L) { if (n > 0) progdir[n] = 0; #elif defined(__sun) pid_t pid = getpid(); - char linkname[256] + char linkname[256]; sprintf(linkname, "/proc/%d/path/a.out", pid); n = readlink(linkname, progdir, nsize); if (n > 0) progdir[n] = 0; |