diff options
| author | Carlos Martín Nieto <cmn@dwim.me> | 2013-01-29 18:00:32 +0100 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@dwim.me> | 2013-01-29 18:46:17 +0100 |
| commit | 67fcac567ba25753e7500e40081bea1a418dc6da (patch) | |
| tree | 673fb1c2d65576677928491fb1097d3d8b1dd072 /src/unix/posix.h | |
| parent | f42beff7e2e74da066eb91dac869c6f2e616f9e3 (diff) | |
| download | libgit2-67fcac567ba25753e7500e40081bea1a418dc6da.tar.gz | |
Fix p_realpath on OpenBSD
OpenBSD's realpath(3) doesn't require the last part of the path to
exist. Override p_realpath in this OS to bring it in line with the
library's assumptions.
Diffstat (limited to 'src/unix/posix.h')
| -rw-r--r-- | src/unix/posix.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/unix/posix.h b/src/unix/posix.h index 2c169bd04..c738b531d 100644 --- a/src/unix/posix.h +++ b/src/unix/posix.h @@ -16,7 +16,12 @@ #define p_unlink(p) unlink(p) #define p_mkdir(p,m) mkdir(p, m) #define p_fsync(fd) fsync(fd) -#define p_realpath(p, po) realpath(p, po) + +/* The OpenBSD realpath function behaves differently */ +#if !defined(__OpenBSD__) +# define p_realpath(p, po) realpath(p, po) +#endif + #define p_vsnprintf(b, c, f, a) vsnprintf(b, c, f, a) #define p_snprintf(b, c, f, ...) snprintf(b, c, f, __VA_ARGS__) #define p_mkstemp(p) mkstemp(p) |
