Author: markj
Date: Wed Oct  8 20:25:21 2014
New Revision: 272766
URL: https://svnweb.freebsd.org/changeset/base/272766

Log:
  Pass up the error status of minidumpsys() to its callers.
  
  PR:           193761
  Submitted by: Conrad Meyer <conrad.me...@isilon.com>
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/amd64/amd64/minidump_machdep.c
  head/sys/amd64/include/md_var.h
  head/sys/arm/arm/dump_machdep.c
  head/sys/arm/arm/minidump_machdep.c
  head/sys/arm/include/md_var.h
  head/sys/i386/i386/minidump_machdep.c
  head/sys/i386/include/md_var.h
  head/sys/mips/include/md_var.h
  head/sys/mips/mips/dump_machdep.c
  head/sys/mips/mips/minidump_machdep.c
  head/sys/x86/x86/dump_machdep.c

Modified: head/sys/amd64/amd64/minidump_machdep.c
==============================================================================
--- head/sys/amd64/amd64/minidump_machdep.c     Wed Oct  8 19:54:42 2014        
(r272765)
+++ head/sys/amd64/amd64/minidump_machdep.c     Wed Oct  8 20:25:21 2014        
(r272766)
@@ -215,7 +215,7 @@ blk_write(struct dumperinfo *di, char *p
 /* A fake page table page, to avoid having to handle both 4K and 2M pages */
 static pd_entry_t fakepd[NPDEPG];
 
-void
+int
 minidumpsys(struct dumperinfo *di)
 {
        uint32_t pmapsize;
@@ -441,7 +441,7 @@ minidumpsys(struct dumperinfo *di)
        /* Signal completion, signoff and exit stage left. */
        dump_write(di, NULL, 0, 0, 0);
        printf("\nDump complete\n");
-       return;
+       return (0);
 
  fail:
        if (error < 0)
@@ -462,6 +462,7 @@ minidumpsys(struct dumperinfo *di)
                printf("Dump failed. Partition too small.\n");
        else
                printf("** DUMP FAILED (ERROR %d) **\n", error);
+       return (error);
 }
 
 void

Modified: head/sys/amd64/include/md_var.h
==============================================================================
--- head/sys/amd64/include/md_var.h     Wed Oct  8 19:54:42 2014        
(r272765)
+++ head/sys/amd64/include/md_var.h     Wed Oct  8 20:25:21 2014        
(r272766)
@@ -118,7 +118,7 @@ void        pagezero(void *addr);
 void   printcpuinfo(void);
 void   setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int ist);
 int    user_dbreg_trap(void);
-void   minidumpsys(struct dumperinfo *);
+int    minidumpsys(struct dumperinfo *);
 struct savefpu *get_pcb_user_save_td(struct thread *td);
 struct savefpu *get_pcb_user_save_pcb(struct pcb *pcb);
 struct pcb *get_pcb_td(struct thread *td);

Modified: head/sys/arm/arm/dump_machdep.c
==============================================================================
--- head/sys/arm/arm/dump_machdep.c     Wed Oct  8 19:54:42 2014        
(r272765)
+++ head/sys/arm/arm/dump_machdep.c     Wed Oct  8 20:25:21 2014        
(r272766)
@@ -280,10 +280,8 @@ dumpsys(struct dumperinfo *di)
        size_t hdrsz;
        int error;
 
-       if (do_minidump) {
-               minidumpsys(di);
-               return (0);
-       }
+       if (do_minidump)
+               return (minidumpsys(di));
 
        bzero(&ehdr, sizeof(ehdr));
        ehdr.e_ident[EI_MAG0] = ELFMAG0;

Modified: head/sys/arm/arm/minidump_machdep.c
==============================================================================
--- head/sys/arm/arm/minidump_machdep.c Wed Oct  8 19:54:42 2014        
(r272765)
+++ head/sys/arm/arm/minidump_machdep.c Wed Oct  8 20:25:21 2014        
(r272766)
@@ -196,7 +196,7 @@ blk_write_cont(struct dumperinfo *di, vm
 /* A fake page table page, to avoid having to handle both 4K and 2M pages */
 static pt_entry_t fakept[NPTEPG];
 
-void
+int
 minidumpsys(struct dumperinfo *di)
 {
        struct minidumphdr mdhdr;
@@ -460,7 +460,7 @@ minidumpsys(struct dumperinfo *di)
        /* Signal completion, signoff and exit stage left. */
        dump_write(di, NULL, 0, 0, 0);
        printf("\nDump complete\n");
-       return;
+       return (0);
 
 fail:
        if (error < 0)
@@ -472,6 +472,7 @@ fail:
                printf("\nDump failed. Partition too small.\n");
        else
                printf("\n** DUMP FAILED (ERROR %d) **\n", error);
+       return (error);
 }
 
 void

Modified: head/sys/arm/include/md_var.h
==============================================================================
--- head/sys/arm/include/md_var.h       Wed Oct  8 19:54:42 2014        
(r272765)
+++ head/sys/arm/include/md_var.h       Wed Oct  8 20:25:21 2014        
(r272766)
@@ -68,6 +68,6 @@ extern int busdma_swi_pending;
 void busdma_swi(void);
 void dump_add_page(vm_paddr_t);
 void dump_drop_page(vm_paddr_t);
-void minidumpsys(struct dumperinfo *);
+int minidumpsys(struct dumperinfo *);
 
 #endif /* !_MACHINE_MD_VAR_H_ */

Modified: head/sys/i386/i386/minidump_machdep.c
==============================================================================
--- head/sys/i386/i386/minidump_machdep.c       Wed Oct  8 19:54:42 2014        
(r272765)
+++ head/sys/i386/i386/minidump_machdep.c       Wed Oct  8 20:25:21 2014        
(r272766)
@@ -178,7 +178,7 @@ blk_write(struct dumperinfo *di, char *p
 /* A fake page table page, to avoid having to handle both 4K and 2M pages */
 static pt_entry_t fakept[NPTEPG];
 
-void
+int
 minidumpsys(struct dumperinfo *di)
 {
        uint64_t dumpsize;
@@ -377,7 +377,7 @@ minidumpsys(struct dumperinfo *di)
        /* Signal completion, signoff and exit stage left. */
        dump_write(di, NULL, 0, 0, 0);
        printf("\nDump complete\n");
-       return;
+       return (0);
 
  fail:
        if (error < 0)
@@ -389,6 +389,7 @@ minidumpsys(struct dumperinfo *di)
                printf("\nDump failed. Partition too small.\n");
        else
                printf("\n** DUMP FAILED (ERROR %d) **\n", error);
+       return (error);
 }
 
 void

Modified: head/sys/i386/include/md_var.h
==============================================================================
--- head/sys/i386/include/md_var.h      Wed Oct  8 19:54:42 2014        
(r272765)
+++ head/sys/i386/include/md_var.h      Wed Oct  8 20:25:21 2014        
(r272766)
@@ -113,6 +113,6 @@ void        ppro_reenable_apic(void);
 void   printcpuinfo(void);
 void   setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec);
 int     user_dbreg_trap(void);
-void   minidumpsys(struct dumperinfo *);
+int    minidumpsys(struct dumperinfo *);
 
 #endif /* !_MACHINE_MD_VAR_H_ */

Modified: head/sys/mips/include/md_var.h
==============================================================================
--- head/sys/mips/include/md_var.h      Wed Oct  8 19:54:42 2014        
(r272765)
+++ head/sys/mips/include/md_var.h      Wed Oct  8 20:25:21 2014        
(r272766)
@@ -79,5 +79,5 @@ void  busdma_swi(void);
 struct dumperinfo;
 void   dump_add_page(vm_paddr_t);
 void   dump_drop_page(vm_paddr_t);
-void   minidumpsys(struct dumperinfo *);
+int    minidumpsys(struct dumperinfo *);
 #endif /* !_MACHINE_MD_VAR_H_ */

Modified: head/sys/mips/mips/dump_machdep.c
==============================================================================
--- head/sys/mips/mips/dump_machdep.c   Wed Oct  8 19:54:42 2014        
(r272765)
+++ head/sys/mips/mips/dump_machdep.c   Wed Oct  8 20:25:21 2014        
(r272766)
@@ -266,10 +266,8 @@ dumpsys(struct dumperinfo *di)
        size_t hdrsz;
        int error;
 
-       if (do_minidump) {
-               minidumpsys(di);
-               return (0);
-       }
+       if (do_minidump)
+               return (minidumpsys(di));
 
        bzero(&ehdr, sizeof(ehdr));
        ehdr.e_ident[EI_MAG0] = ELFMAG0;

Modified: head/sys/mips/mips/minidump_machdep.c
==============================================================================
--- head/sys/mips/mips/minidump_machdep.c       Wed Oct  8 19:54:42 2014        
(r272765)
+++ head/sys/mips/mips/minidump_machdep.c       Wed Oct  8 20:25:21 2014        
(r272766)
@@ -153,7 +153,7 @@ write_buffer(struct dumperinfo *di, char
        return (0);
 }
 
-void
+int
 minidumpsys(struct dumperinfo *di)
 {
        struct minidumphdr mdhdr;
@@ -325,7 +325,7 @@ minidumpsys(struct dumperinfo *di)
        /* Signal completion, signoff and exit stage left. */
        dump_write(di, NULL, 0, 0, 0);
        printf("\nDump complete\n");
-       return;
+       return (0);
 
 fail:
        if (error < 0)
@@ -337,4 +337,5 @@ fail:
                printf("\nDump failed. Partition too small.\n");
        else
                printf("\n** DUMP FAILED (ERROR %d) **\n", error);
+       return (error);
 }

Modified: head/sys/x86/x86/dump_machdep.c
==============================================================================
--- head/sys/x86/x86/dump_machdep.c     Wed Oct  8 19:54:42 2014        
(r272765)
+++ head/sys/x86/x86/dump_machdep.c     Wed Oct  8 20:25:21 2014        
(r272766)
@@ -275,10 +275,9 @@ dumpsys(struct dumperinfo *di)
        size_t hdrsz;
        int error;
 
-       if (do_minidump) {
-               minidumpsys(di);
-               return (0);
-       }
+       if (do_minidump)
+               return (minidumpsys(di));
+
        bzero(&ehdr, sizeof(ehdr));
        ehdr.e_ident[EI_MAG0] = ELFMAG0;
        ehdr.e_ident[EI_MAG1] = ELFMAG1;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to