FreeBSD Bugzilla – Attachment 147460 Details for
Bug 193761
[PATCH] Add error return to minidumpsys(), use in dumpsys()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
(Applies to CURRENT with -p0.)
a.patch (text/plain), 6.05 KB, created by
Conrad Meyer
on 2014-09-19 02:56:11 UTC
(
hide
)
Description:
(Applies to CURRENT with -p0.)
Filename:
MIME Type:
Creator:
Conrad Meyer
Created:
2014-09-19 02:56:11 UTC
Size:
6.05 KB
patch
obsolete
>Index: sys/amd64/amd64/minidump_machdep.c >=================================================================== >--- sys/amd64/amd64/minidump_machdep.c (revision 271797) >+++ sys/amd64/amd64/minidump_machdep.c (working copy) >@@ -215,7 +215,7 @@ > /* 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 @@ > /* 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 @@ > printf("Dump failed. Partition too small.\n"); > else > printf("** DUMP FAILED (ERROR %d) **\n", error); >+ return (error); > } > > void >Index: sys/amd64/include/md_var.h >=================================================================== >--- sys/amd64/include/md_var.h (revision 271797) >+++ sys/amd64/include/md_var.h (working copy) >@@ -118,7 +118,7 @@ > 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); >Index: sys/arm/arm/dump_machdep.c >=================================================================== >--- sys/arm/arm/dump_machdep.c (revision 271797) >+++ sys/arm/arm/dump_machdep.c (working copy) >@@ -280,10 +280,8 @@ > 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; >Index: sys/arm/arm/minidump_machdep.c >=================================================================== >--- sys/arm/arm/minidump_machdep.c (revision 271797) >+++ sys/arm/arm/minidump_machdep.c (working copy) >@@ -196,7 +196,7 @@ > /* 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 @@ > /* 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 @@ > printf("\nDump failed. Partition too small.\n"); > else > printf("\n** DUMP FAILED (ERROR %d) **\n", error); >+ return (error); > } > > void >Index: sys/arm/include/md_var.h >=================================================================== >--- sys/arm/include/md_var.h (revision 271797) >+++ sys/arm/include/md_var.h (working copy) >@@ -68,6 +68,6 @@ > 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_ */ >Index: sys/i386/i386/minidump_machdep.c >=================================================================== >--- sys/i386/i386/minidump_machdep.c (revision 271797) >+++ sys/i386/i386/minidump_machdep.c (working copy) >@@ -178,7 +178,7 @@ > /* 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 @@ > /* 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 @@ > printf("\nDump failed. Partition too small.\n"); > else > printf("\n** DUMP FAILED (ERROR %d) **\n", error); >+ return (error); > } > > void >Index: sys/i386/include/md_var.h >=================================================================== >--- sys/i386/include/md_var.h (revision 271797) >+++ sys/i386/include/md_var.h (working copy) >@@ -113,6 +113,6 @@ > 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_ */ >Index: sys/mips/include/md_var.h >=================================================================== >--- sys/mips/include/md_var.h (revision 271797) >+++ sys/mips/include/md_var.h (working copy) >@@ -79,5 +79,5 @@ > 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_ */ >Index: sys/mips/mips/dump_machdep.c >=================================================================== >--- sys/mips/mips/dump_machdep.c (revision 271797) >+++ sys/mips/mips/dump_machdep.c (working copy) >@@ -266,10 +266,8 @@ > 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; >Index: sys/mips/mips/minidump_machdep.c >=================================================================== >--- sys/mips/mips/minidump_machdep.c (revision 271797) >+++ sys/mips/mips/minidump_machdep.c (working copy) >@@ -153,7 +153,7 @@ > return (0); > } > >-void >+int > minidumpsys(struct dumperinfo *di) > { > struct minidumphdr mdhdr; >@@ -325,7 +325,7 @@ > /* 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 @@ > printf("\nDump failed. Partition too small.\n"); > else > printf("\n** DUMP FAILED (ERROR %d) **\n", error); >+ return (error); > } >Index: sys/x86/x86/dump_machdep.c >=================================================================== >--- sys/x86/x86/dump_machdep.c (revision 271797) >+++ sys/x86/x86/dump_machdep.c (working copy) >@@ -275,10 +275,9 @@ > 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;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 193761
: 147460