Skip to content

Commit

Permalink
Merge pull request #26 from myfreeweb/master
Browse files Browse the repository at this point in the history
Fix fs on FreeBSD
  • Loading branch information
Cloudef authored Dec 8, 2016
2 parents 55d41fb + 974ea18 commit 0036426
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions chck/fs/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# include <mach-o/dyld.h>
#endif

#if defined(BSD)
#if defined(BSD) || defined(__FreeBSD__)
# include <sys/param.h>
# include <sys/sysctl.h>
#endif
Expand Down Expand Up @@ -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;
Expand All @@ -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";
Expand All @@ -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
Expand Down

0 comments on commit 0036426

Please sign in to comment.