From ee0e0f9943f84e4748c9a615f7bc6869f04f7711 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Mon, 15 Aug 2011 14:38:49 +0000 Subject: [PATCH] * src/groupmod.c: Check atexit failures. --- ChangeLog | 1 + src/groupmod.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0b86af51..3ef73198 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ * src/groupmod.c: Ignore return value from snprintf. * src/groupmod.c: Add static qualifier to the cleanup structures. + * src/groupmod.c: Check atexit failures. 2011-08-15 Nicolas François diff --git a/src/groupmod.c b/src/groupmod.c index c769f6b6..acd05964 100644 --- a/src/groupmod.c +++ b/src/groupmod.c @@ -736,7 +736,6 @@ int main (int argc, char **argv) #ifdef WITH_AUDIT audit_help_open (); #endif - atexit (do_cleanups); /* * Get my name so that I can use it to report errors. @@ -747,6 +746,13 @@ int main (int argc, char **argv) (void) bindtextdomain (PACKAGE, LOCALEDIR); (void) textdomain (PACKAGE); + if (atexit (do_cleanups) != 0) { + fprintf (stderr, + _("%s: Cannot setup cleanup service.\n"), + Prog); + exit (1); + } + process_flags (argc, argv); OPENLOG ("groupmod");