From 3296ae4d01ab31e651b217650d1441e1e3fdbebd Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 3 May 2014 20:42:12 +0200 Subject: compile-time configurable api-fs path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/config.h | 8 ++++++++ src/mds-server.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/config.h b/src/config.h index 6d38a14..da3ff81 100644 --- a/src/config.h +++ b/src/config.h @@ -117,6 +117,14 @@ #endif +/** + * The path of the symlink to the executed command + */ +#ifndef SELF_EXE +#define SELF_EXE "/proc/self/exe" +#endif + + /** * The maximum number of command line arguments to allow */ diff --git a/src/mds-server.c b/src/mds-server.c index eb35daf..d0259f3 100644 --- a/src/mds-server.c +++ b/src/mds-server.c @@ -349,7 +349,7 @@ int main(int argc_, char** argv_) close(pipe_rw[1]); /* Re-exec the server. */ - readlink_ptr = readlink("/proc/self/exe", readlink_buf, PATH_MAX - 1); + readlink_ptr = readlink(SELF_EXE, readlink_buf, PATH_MAX - 1); if (readlink_ptr < 0) goto reexec_fail; /* ‘readlink() does not append a null byte to buf.’ */ -- cgit v1.2.3-70-g09d2