From 974ea189d329e2eb624b2baac9cd08791aa476fd Mon Sep 17 00:00:00 2001 From: Greg V Date: Thu, 8 Dec 2016 15:24:21 +0300 Subject: [PATCH] Fix fs on FreeBSD --- chck/fs/fs.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/chck/fs/fs.c b/chck/fs/fs.c index e6300f5..67a38bd 100644 --- a/chck/fs/fs.c +++ b/chck/fs/fs.c @@ -14,7 +14,7 @@ # include #endif -#if defined(BSD) +#if defined(BSD) || defined(__FreeBSD__) # include # include #endif @@ -121,7 +121,7 @@ chck_get_executable_path(void) #elif defined(_WIN32) || defined(_WIN64) if (_pgmptr && !(exepath = ccopy(_pgmptr))) return NULL; if (exepath) return exepath; -#elif defined(BSD) /* works on all BSD's? */ +#elif defined(BSD) || defined(__FreeBSD__) /* works on all BSD's? */ int mib[4]; mib[0] = CTL_KERN; mib[1] = KERN_PROC; @@ -140,7 +140,7 @@ chck_get_executable_path(void) path = "/proc/self/exe"; #elif defined(__NetBSD__) path = "/proc/curproc/exe"; -#elif defined(BSD) +#elif defined(BSD) || defined(__FreeBSD__) path = "/proc/curproc/file"; #elif defined(__sun) path = "/proc/self/path/a.out"; @@ -150,8 +150,6 @@ chck_get_executable_path(void) path = NULL; #elif defined(EMSCRIPTEN) path = NULL; -#elif defined(__FreeBSD__) - path = NULL; #else # error insert your OS here #endif