diff options
author | Zach Loafman <zachary.loafman@isilon.com> | 2008-07-10 18:45:48 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2008-07-10 15:24:57 -0700 |
commit | 55f676550a909fddfb3b79a4aaa7aef4286dcd11 (patch) | |
tree | 2059ba4e7663845219bfb8b8002b554f460ebc66 /source3 | |
parent | 90f3da47205e670bfdde26d5c7858238a5ed7716 (diff) | |
download | samba-55f676550a909fddfb3b79a4aaa7aef4286dcd11.tar.gz samba-55f676550a909fddfb3b79a4aaa7aef4286dcd11.tar.bz2 samba-55f676550a909fddfb3b79a4aaa7aef4286dcd11.zip |
Fix realpath() check so that it doesn't generate a core() when it fails.
(This used to be commit 5fdbf89c898efff57c65061ea2c360d2cd91bcec)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/configure.in | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source3/configure.in b/source3/configure.in index fc66c17425..2ae5e35295 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -2795,9 +2795,17 @@ AC_CACHE_CHECK([if the realpath function allows a NULL argument],samba_cv_REALPA AC_TRY_RUN([ #include <stdio.h> #include <limits.h> +#include <signal.h> + +void exit_on_core(int ignored) { + exit(1); +} + main() { - char *newpath = realpath("/tmp", NULL); - exit ((newpath != NULL) ? 0 : 1); + char *newpath; + signal(SIGSEGV, exit_on_core); + newpath = realpath("/tmp", NULL); + exit((newpath != NULL) ? 0 : 1); } ], samba_cv_REALPATH_TAKES_NULL=yes,samba_cv_REALPATH_TAKES_NULL=no,samba_cv_REALPATH_TAKES_NULL=cross)]) |