[parted-devel] (_dump_history): Remove six cpp directives, add one.

Jim Meyering jim at meyering.net
Tue Mar 6 10:31:58 CET 2007


Just removing some #ifdefs...

 parted/ui.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/parted/ui.c b/parted/ui.c
index 524c933..a20c0bc 100644
--- a/parted/ui.c
+++ b/parted/ui.c
@@ -276,7 +276,7 @@ _add_history_unique (const char* line)
 
 /* Prints command history, to be used before aborting */
 static void
-_dump_history ()
+_dump_history (void)
 {
         int             i = 0;
         HIST_ENTRY**    all_entries = history_list ();
@@ -286,6 +286,8 @@ _dump_history ()
                 puts(all_entries[i++]->line);
         }
 }
+#else
+static inline void _dump_history (void) {}
 #endif /* HAVE_LIBREADLINE */
 
 static void
@@ -344,9 +346,7 @@ static void
 sa_sigsegv_handler (int signum, siginfo_t* info, void* ucontext)
 {
         printf (bug_msg, VERSION);
-        #ifdef HAVE_LIBREADLINE
         _dump_history ();
-        #endif
 
         if (!info)
                 abort ();
@@ -390,9 +390,7 @@ static void
 sa_sigfpe_handler (int signum, siginfo_t* info, void* ucontext)
 {
         printf (bug_msg, VERSION);
-        #ifdef HAVE_LIBREADLINE
         _dump_history ();
-        #endif
 
         if (!info)
                 abort ();
@@ -465,9 +463,7 @@ static void
 sa_sigill_handler (int signum, siginfo_t* info, void* ucontext)
 {
         printf (bug_msg, VERSION);
-        #ifdef HAVE_LIBREADLINE
         _dump_history ();
-        #endif
 
         if (!info)
                 abort();



More information about the parted-devel mailing list