From 584784ba6d6db6f24d3310f2d458cae50380792b Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 12 Feb 2004 09:28:32 +0000 Subject: minor cleanups --- common/sysutils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'common/sysutils.c') diff --git a/common/sysutils.c b/common/sysutils.c index 6eb40b125..4948af57f 100644 --- a/common/sysutils.c +++ b/common/sysutils.c @@ -117,7 +117,8 @@ get_session_marker( size_t *rlen ) } -#if 0 /* not yet needed */ +#if 0 /* not yet needed - Note that this will require inclusion of + cmacros.am in Makefile.am */ int check_permissions(const char *path,int extension,int checkonly) { -- cgit v1.2.3 From ac791c0a9a4bcd6ec1785d1689994b578a9edf82 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 11 May 2004 09:54:52 +0000 Subject: * sysutils.c (disable_core_dumps): Only set the current limit. (enable_core_dumps): New. * gpgsm.texi (Esoteric Options): Add --debug-allow-core-dump. * gpgsm.c: New option --debug-allow-core-dump. * gpgsm.h (opt): Add member CONFIG_FILENAME. * gpgsm.c (main): Use it here instead of the local var. * server.c (gpgsm_server): Print some additional information with the hello in verbose mode. --- common/sysutils.c | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) (limited to 'common/sysutils.c') diff --git a/common/sysutils.c b/common/sysutils.c index 4948af57f..97fa23d95 100644 --- a/common/sysutils.c +++ b/common/sysutils.c @@ -70,21 +70,44 @@ trap_unaligned(void) int disable_core_dumps (void) { - #ifdef HAVE_DOSISH_SYSTEM +#ifdef HAVE_DOSISH_SYSTEM return 0; - #else - #ifdef HAVE_SETRLIMIT +#else +# ifdef HAVE_SETRLIMIT struct rlimit limit; + /* We only set the current limit unless we were not able to + retrieve the old value. */ + if (getrlimit (RLIMIT_CORE, &limit)) + limit.rlim_max = 0; limit.rlim_cur = 0; - limit.rlim_max = 0; - if( !setrlimit( RLIMIT_CORE, &limit ) ) + if( !setrlimit (RLIMIT_CORE, &limit) ) return 0; if( errno != EINVAL && errno != ENOSYS ) log_fatal (_("can't disable core dumps: %s\n"), strerror(errno) ); - #endif +#endif + return 1; +#endif +} + +int +enable_core_dumps (void) +{ +#ifdef HAVE_DOSISH_SYSTEM + return 0; +#else +# ifdef HAVE_SETRLIMIT + struct rlimit limit; + + if (getrlimit (RLIMIT_CORE, &limit)) + return 1; + limit.rlim_cur = limit.rlim_max; + setrlimit (RLIMIT_CORE, &limit); + return 1; /* We always return true because trhis function is + merely a debugging aid. */ +#endif return 1; - #endif +#endif } -- cgit v1.2.3 From 33701641829798ddd7fced64cf9a504cc5f48cc1 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 7 Jun 2005 19:09:18 +0000 Subject: New debugging optionhs, updates to the manual. --- common/sysutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common/sysutils.c') diff --git a/common/sysutils.c b/common/sysutils.c index 97fa23d95..a8f6f6f5d 100644 --- a/common/sysutils.c +++ b/common/sysutils.c @@ -105,7 +105,7 @@ enable_core_dumps (void) setrlimit (RLIMIT_CORE, &limit); return 1; /* We always return true because trhis function is merely a debugging aid. */ -#endif +# endif return 1; #endif } -- cgit v1.2.3 From f98537733ac96fd7e786286944fd3c2696229c4f Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 20 Jun 2006 17:21:37 +0000 Subject: Updated FSF's address. --- common/sysutils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'common/sysutils.c') diff --git a/common/sysutils.c b/common/sysutils.c index a8f6f6f5d..3e52cdaa3 100644 --- a/common/sysutils.c +++ b/common/sysutils.c @@ -15,7 +15,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. */ #include -- cgit v1.2.3