Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Jul 2014 23:52:54 +0000 (UTC)
From:      Gavin Atkinson <gavin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r269105 - in head/sys: arm/arm kern mips/mips powerpc/powerpc sparc64/sparc64 sys x86/x86
Message-ID:  <201407252352.s6PNqskY049781@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gavin
Date: Fri Jul 25 23:52:53 2014
New Revision: 269105
URL: http://svnweb.freebsd.org/changeset/base/269105

Log:
  Add error return to dumpsys(), and use it in doadump().
  
  This commit does not add error returns to minidumpsys() or
  textdump_dumpsys(); those can also be added later.
  
  Submitted by:	Conrad Meyer (EMC / Isilon storage division)

Modified:
  head/sys/arm/arm/dump_machdep.c
  head/sys/kern/kern_shutdown.c
  head/sys/mips/mips/dump_machdep.c
  head/sys/powerpc/powerpc/dump_machdep.c
  head/sys/sparc64/sparc64/dump_machdep.c
  head/sys/sys/conf.h
  head/sys/x86/x86/dump_machdep.c

Modified: head/sys/arm/arm/dump_machdep.c
==============================================================================
--- head/sys/arm/arm/dump_machdep.c	Fri Jul 25 23:36:39 2014	(r269104)
+++ head/sys/arm/arm/dump_machdep.c	Fri Jul 25 23:52:53 2014	(r269105)
@@ -271,7 +271,7 @@ foreach_chunk(callback_t cb, void *arg)
 	return (seqnr);
 }
 
-void
+int
 dumpsys(struct dumperinfo *di)
 {
 	Elf_Ehdr ehdr;
@@ -282,7 +282,7 @@ dumpsys(struct dumperinfo *di)
 
 	if (do_minidump) {
 		minidumpsys(di);
-		return;
+		return (0);
 	}
 
 	bzero(&ehdr, sizeof(ehdr));
@@ -368,7 +368,7 @@ dumpsys(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)
@@ -380,4 +380,5 @@ dumpsys(struct dumperinfo *di)
 		printf("\nDump failed. Partition too small.\n");
 	else
 		printf("\n** DUMP FAILED (ERROR %d) **\n", error);
+	return (error);
 }

Modified: head/sys/kern/kern_shutdown.c
==============================================================================
--- head/sys/kern/kern_shutdown.c	Fri Jul 25 23:36:39 2014	(r269104)
+++ head/sys/kern/kern_shutdown.c	Fri Jul 25 23:52:53 2014	(r269105)
@@ -249,7 +249,9 @@ int
 doadump(boolean_t textdump)
 {
 	boolean_t coredump;
+	int error;
 
+	error = 0;
 	if (dumping)
 		return (EBUSY);
 	if (dumper.dumper == NULL)
@@ -267,10 +269,10 @@ doadump(boolean_t textdump)
 	}
 #endif
 	if (coredump)
-		dumpsys(&dumper);
+		error = dumpsys(&dumper);
 
 	dumping--;
-	return (0);
+	return (error);
 }
 
 static int

Modified: head/sys/mips/mips/dump_machdep.c
==============================================================================
--- head/sys/mips/mips/dump_machdep.c	Fri Jul 25 23:36:39 2014	(r269104)
+++ head/sys/mips/mips/dump_machdep.c	Fri Jul 25 23:52:53 2014	(r269105)
@@ -257,7 +257,7 @@ foreach_chunk(callback_t cb, void *arg)
 	return (seqnr);
 }
 
-void
+int
 dumpsys(struct dumperinfo *di)
 {
 	Elf_Ehdr ehdr;
@@ -268,7 +268,7 @@ dumpsys(struct dumperinfo *di)
 
 	if (do_minidump) {
 		minidumpsys(di);
-		return;
+		return (0);
 	}
 
 	bzero(&ehdr, sizeof(ehdr));
@@ -354,7 +354,7 @@ dumpsys(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)
@@ -366,4 +366,5 @@ dumpsys(struct dumperinfo *di)
 		printf("\nDump failed. Partition too small.\n");
 	else
 		printf("\n** DUMP FAILED (ERROR %d) **\n", error);
+	return (error);
 }

Modified: head/sys/powerpc/powerpc/dump_machdep.c
==============================================================================
--- head/sys/powerpc/powerpc/dump_machdep.c	Fri Jul 25 23:36:39 2014	(r269104)
+++ head/sys/powerpc/powerpc/dump_machdep.c	Fri Jul 25 23:52:53 2014	(r269105)
@@ -205,7 +205,7 @@ foreach_chunk(callback_t cb, void *arg)
 	return (seqnr);
 }
 
-void
+int
 dumpsys(struct dumperinfo *di)
 {
 	Elf_Ehdr ehdr;
@@ -299,7 +299,7 @@ dumpsys(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)
@@ -311,4 +311,5 @@ dumpsys(struct dumperinfo *di)
 		printf("\nDump failed. Partition too small.\n");
 	else
 		printf("\n** DUMP FAILED (ERROR %d) **\n", error);
+	return (error);
 }

Modified: head/sys/sparc64/sparc64/dump_machdep.c
==============================================================================
--- head/sys/sparc64/sparc64/dump_machdep.c	Fri Jul 25 23:36:39 2014	(r269104)
+++ head/sys/sparc64/sparc64/dump_machdep.c	Fri Jul 25 23:52:53 2014	(r269105)
@@ -142,7 +142,7 @@ blk_dump(struct dumperinfo *di, vm_paddr
 	return (error);
 }
 
-void
+int
 dumpsys(struct dumperinfo *di)
 {
 	struct sparc64_dump_hdr hdr;
@@ -218,9 +218,10 @@ dumpsys(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:
 	/* XXX It should look more like VMS :-) */
 	printf("** DUMP FAILED (ERROR %d) **\n", error);
+	return (error);
 }

Modified: head/sys/sys/conf.h
==============================================================================
--- head/sys/sys/conf.h	Fri Jul 25 23:36:39 2014	(r269104)
+++ head/sys/sys/conf.h	Fri Jul 25 23:52:53 2014	(r269105)
@@ -336,7 +336,7 @@ struct dumperinfo {
 
 int set_dumper(struct dumperinfo *, const char *_devname);
 int dump_write(struct dumperinfo *, void *, vm_offset_t, off_t, size_t);
-void dumpsys(struct dumperinfo *);
+int dumpsys(struct dumperinfo *);
 int doadump(boolean_t);
 extern int dumping;		/* system is dumping */
 

Modified: head/sys/x86/x86/dump_machdep.c
==============================================================================
--- head/sys/x86/x86/dump_machdep.c	Fri Jul 25 23:36:39 2014	(r269104)
+++ head/sys/x86/x86/dump_machdep.c	Fri Jul 25 23:52:53 2014	(r269105)
@@ -266,7 +266,7 @@ foreach_chunk(callback_t cb, void *arg)
 	return (seqnr);
 }
 
-void
+int
 dumpsys(struct dumperinfo *di)
 {
 	Elf_Ehdr ehdr;
@@ -277,7 +277,7 @@ dumpsys(struct dumperinfo *di)
 
 	if (do_minidump) {
 		minidumpsys(di);
-		return;
+		return (0);
 	}
 	bzero(&ehdr, sizeof(ehdr));
 	ehdr.e_ident[EI_MAG0] = ELFMAG0;
@@ -363,7 +363,7 @@ dumpsys(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)
@@ -375,4 +375,5 @@ dumpsys(struct dumperinfo *di)
 		printf("\nDump failed. Partition too small.\n");
 	else
 		printf("\n** DUMP FAILED (ERROR %d) **\n", error);
+	return (error);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407252352.s6PNqskY049781>