emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] pdumper dc87600 2/3: Report dump load status


From: Daniel Colascione
Subject: [Emacs-diffs] pdumper dc87600 2/3: Report dump load status
Date: Thu, 15 Feb 2018 16:48:39 -0500 (EST)

branch: pdumper
commit dc87600c9a673fc0b19293ea4a8040eca98db602
Author: Daniel Colascione <address@hidden>
Commit: Daniel Colascione <address@hidden>

    Report dump load status
---
 src/emacs.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/emacs.c b/src/emacs.c
index 1e8416d..0d7c6ed 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -732,8 +732,11 @@ dump_error_to_string (enum pdumper_load_result result)
     }
 }
 
-static const char *
-load_dump (int *inout_argc, char ***inout_argv, const char *argv0_base)
+static enum pdumper_load_result
+load_dump (int *inout_argc,
+           char ***inout_argv,
+           const char *argv0_base,
+           const char** out_dump_file)
 {
   int argc = *inout_argc;
   char **argv = *inout_argv;
@@ -754,7 +757,7 @@ load_dump (int *inout_argc, char ***inout_argv, const char 
*argv0_base)
     fatal ("cannot load dump file into unexeced Emacs");
 
   if (initialized)
-    return NULL;
+    abort ();
 
   result = PDUMPER_NOT_LOADED;
   if (dump_file)
@@ -812,9 +815,10 @@ load_dump (int *inout_argc, char ***inout_argv, const char 
*argv0_base)
     dump_file = NULL;
 
  out:
+  *out_dump_file = dump_file ? strdup (dump_file) : NULL;
   *inout_argc = argc;
   *inout_argv = argv;
-           return dump_file ? strdup (dump_file) : NULL;
+  return result;
 }
 #endif /* HAVE_PDUMPER */
 
@@ -908,14 +912,17 @@ main (int argc, char **argv)
 #ifdef HAVE_PDUMPER
       struct timeval start;
       gettimeofday (&start, NULL);
-      loaded_dump = load_dump (&argc, &argv, argv0_base);
-      struct timeval end ;
+      const char *loaded_dump = NULL;
+      enum pdumper_load_result result =
+        load_dump (&argc, &argv, argv0_base, &loaded_dump);
+      struct timeval end;
       gettimeofday (&end, NULL);
       double tdif =
        1000.0 * (end.tv_sec - start.tv_sec)
        + (end.tv_usec - start.tv_usec) / 1.0e3;
-      fprintf (stderr, "load_dump %s %g milliseconds\n",
-              loaded_dump ? "completed in" : "failed after", tdif);
+      fprintf (stderr, "load_dump %s %g milliseconds: result=%d\n",
+              loaded_dump ? "completed in" : "failed after",
+               tdif, (int) result);
 #endif
     }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]