aboutsummaryrefslogtreecommitdiffstats
path: root/g10/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/misc.c')
-rw-r--r--g10/misc.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/g10/misc.c b/g10/misc.c
index 1e4f4916d..9669af574 100644
--- a/g10/misc.c
+++ b/g10/misc.c
@@ -79,22 +79,23 @@ trap_unaligned(void)
#endif
-void
+int
disable_core_dumps()
{
- #ifndef HAVE_DOSISH_SYSTEM
+ #ifdef HAVE_DOSISH_SYSTEM
+ return 0;
+ #else
#ifdef HAVE_SETRLIMIT
struct rlimit limit;
limit.rlim_cur = 0;
limit.rlim_max = 0;
if( !setrlimit( RLIMIT_CORE, &limit ) )
- return;
- if( errno != EINVAL )
+ return 0;
+ if( errno != EINVAL && errno != ENOSYS )
log_fatal(_("can't disable core dumps: %s\n"), strerror(errno) );
#endif
- if( !opt.quiet )
- log_info(_("WARNING: program may create a core file!\n"));
+ return 1;
#endif
}