Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Sep 2014 12:00:51 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r272298 - head/sys/geom
Message-ID:  <201409301200.s8UC0p7Q047144@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Tue Sep 30 12:00:50 2014
New Revision: 272298
URL: http://svnweb.freebsd.org/changeset/base/272298

Log:
  Be prepared that set_dumper() might fail even when resetting it or prefix
  the call with (void) to document that we intentionally ignore the return
  value - no way to handle an error in case of device disappearing.

Modified:
  head/sys/geom/geom_dev.c

Modified: head/sys/geom/geom_dev.c
==============================================================================
--- head/sys/geom/geom_dev.c	Tue Sep 30 11:51:32 2014	(r272297)
+++ head/sys/geom/geom_dev.c	Tue Sep 30 12:00:50 2014	(r272298)
@@ -396,8 +396,7 @@ g_dev_ioctl(struct cdev *dev, u_long cmd
 		break;
 	case DIOCSKERNELDUMP:
 		if (*(u_int *)data != 0) {
-			set_dumper(NULL, NULL);
-			error = 0;
+			error = set_dumper(NULL, NULL);
 			break;
 		}
 		kd.offset = 0;
@@ -616,7 +615,7 @@ g_dev_orphan(struct g_consumer *cp)
 
 	/* Reset any dump-area set on this device */
 	if (dev->si_flags & SI_DUMPDEV)
-		set_dumper(NULL, NULL);
+		(void)set_dumper(NULL, NULL);
 
 	/* Destroy the struct cdev *so we get no more requests */
 	destroy_dev_sched_cb(dev, g_dev_callback, cp);



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