Pass up the error status of minidumpsys() to its callers.

PR:		193761
Submitted by:	Conrad Meyer <conrad.meyer@isilon.com>
Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
markj 2014-10-08 20:25:21 +00:00
parent 278287166d
commit 0ebf86e1b1
11 changed files with 23 additions and 24 deletions

View File

@ -215,7 +215,7 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz)
/* 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

View File

@ -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);

View File

@ -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;

View File

@ -196,7 +196,7 @@ blk_write_cont(struct dumperinfo *di, vm_paddr_t pa, size_t sz)
/* 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 @@ minidumpsys(struct dumperinfo *di)
printf("\nDump failed. Partition too small.\n");
else
printf("\n** DUMP FAILED (ERROR %d) **\n", error);
return (error);
}
void

View File

@ -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_ */

View File

@ -178,7 +178,7 @@ blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz)
/* 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

View File

@ -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_ */

View File

@ -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_ */

View File

@ -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;

View File

@ -153,7 +153,7 @@ write_buffer(struct dumperinfo *di, char *ptr, size_t sz)
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 @@ minidumpsys(struct dumperinfo *di)
printf("\nDump failed. Partition too small.\n");
else
printf("\n** DUMP FAILED (ERROR %d) **\n", error);
return (error);
}

View File

@ -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;