[Midnightbsd-cvs] src [11207] trunk/sbin/geom: sync up
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sun Jul 1 16:42:38 EDT 2018
Revision: 11207
http://svnweb.midnightbsd.org/src/?rev=11207
Author: laffer1
Date: 2018-07-01 16:42:37 -0400 (Sun, 01 Jul 2018)
Log Message:
-----------
sync up
Modified Paths:
--------------
trunk/sbin/geom/Makefile
trunk/sbin/geom/Makefile.inc
trunk/sbin/geom/core/Makefile
trunk/sbin/geom/core/geom.8
trunk/sbin/geom/core/geom.c
trunk/sbin/geom/core/geom.h
trunk/sbin/geom/misc/subr.c
Property Changed:
----------------
trunk/sbin/geom/Makefile.inc
trunk/sbin/geom/core/geom.8
Modified: trunk/sbin/geom/Makefile
===================================================================
--- trunk/sbin/geom/Makefile 2018-07-01 20:41:49 UTC (rev 11206)
+++ trunk/sbin/geom/Makefile 2018-07-01 20:42:37 UTC (rev 11207)
@@ -1,4 +1,5 @@
# $MidnightBSD$
+# $FreeBSD: stable/10/sbin/geom/Makefile 276486 2014-12-31 23:25:37Z ngie $
.if defined(RESCUE) || defined(RELEASE_CRUNCH)
@@ -9,7 +10,7 @@
PROG= geom
SRCS= geom.c geom_label.c geom_part.c subr.c
-NO_MAN=
+MAN=
WARNS?= 2
CFLAGS+=-I${.CURDIR} -I${.CURDIR}/core -DSTATIC_GEOM_CLASSES
Modified: trunk/sbin/geom/Makefile.inc
===================================================================
--- trunk/sbin/geom/Makefile.inc 2018-07-01 20:41:49 UTC (rev 11206)
+++ trunk/sbin/geom/Makefile.inc 2018-07-01 20:42:37 UTC (rev 11207)
@@ -1,4 +1,5 @@
# $MidnightBSD$
+# $FreeBSD: stable/10/sbin/geom/Makefile.inc 216470 2010-12-15 23:45:12Z obrien $
GEOM_CLASS_DIR?=/lib/geom
Property changes on: trunk/sbin/geom/Makefile.inc
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sbin/geom/core/Makefile
===================================================================
--- trunk/sbin/geom/core/Makefile 2018-07-01 20:41:49 UTC (rev 11206)
+++ trunk/sbin/geom/core/Makefile 2018-07-01 20:42:37 UTC (rev 11207)
@@ -1,4 +1,5 @@
# $MidnightBSD$
+# $FreeBSD: stable/10/sbin/geom/core/Makefile 216470 2010-12-15 23:45:12Z obrien $
.PATH: ${.CURDIR}/../misc
Modified: trunk/sbin/geom/core/geom.8
===================================================================
--- trunk/sbin/geom/core/geom.8 2018-07-01 20:41:49 UTC (rev 11206)
+++ trunk/sbin/geom/core/geom.8 2018-07-01 20:42:37 UTC (rev 11207)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
.\" Copyright (c) 2004-2005 Pawel Jakub Dawidek <pjd at FreeBSD.org>
.\" All rights reserved.
.\"
@@ -22,7 +23,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $MidnightBSD$
+.\" $FreeBSD: stable/10/sbin/geom/core/geom.8 307403 2016-10-16 22:02:50Z sevan $
.\"
.Dd January 5, 2011
.Dt GEOM 8
@@ -203,4 +204,4 @@
utility appeared in
.Fx 5.3 .
.Sh AUTHORS
-.An Pawel Jakub Dawidek Aq pjd at FreeBSD.org
+.An Pawel Jakub Dawidek Aq Mt pjd at FreeBSD.org
Property changes on: trunk/sbin/geom/core/geom.8
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/sbin/geom/core/geom.c
===================================================================
--- trunk/sbin/geom/core/geom.c 2018-07-01 20:41:49 UTC (rev 11206)
+++ trunk/sbin/geom/core/geom.c 2018-07-01 20:42:37 UTC (rev 11207)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 2004-2009 Pawel Jakub Dawidek <pjd at FreeBSD.org>
* All rights reserved.
@@ -25,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sbin/geom/core/geom.c 297019 2016-03-18 13:29:43Z mav $");
#include <sys/param.h>
#include <sys/linker.h>
@@ -74,7 +75,7 @@
static void std_load(struct gctl_req *req, unsigned flags);
static void std_unload(struct gctl_req *req, unsigned flags);
-struct g_command std_commands[] = {
+static struct g_command std_commands[] = {
{ "help", 0, std_help, G_NULL_OPTS, NULL },
{ "list", 0, std_list,
{
@@ -635,8 +636,7 @@
} else if (!strcasecmp(class_name, "label")) {
version = &glabel_version;
class_commands = glabel_class_commands;
- } else
- errx(EXIT_FAILURE, "Invalid class name.");
+ }
#endif /* !STATIC_GEOM_CLASSES */
set_class_name();
Modified: trunk/sbin/geom/core/geom.h
===================================================================
--- trunk/sbin/geom/core/geom.h 2018-07-01 20:41:49 UTC (rev 11206)
+++ trunk/sbin/geom/core/geom.h 2018-07-01 20:42:37 UTC (rev 11207)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 2004 Pawel Jakub Dawidek <pjd at FreeBSD.org>
* All rights reserved.
@@ -23,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $MidnightBSD$
+ * $FreeBSD: stable/10/sbin/geom/core/geom.h 212615 2010-09-14 16:22:22Z pjd $
*/
#ifndef _GEOM_H_
Modified: trunk/sbin/geom/misc/subr.c
===================================================================
--- trunk/sbin/geom/misc/subr.c 2018-07-01 20:41:49 UTC (rev 11206)
+++ trunk/sbin/geom/misc/subr.c 2018-07-01 20:42:37 UTC (rev 11207)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 2004-2010 Pawel Jakub Dawidek <pjd at FreeBSD.org>
* All rights reserved.
@@ -25,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/sbin/geom/misc/subr.c 330737 2018-03-10 04:17:01Z asomers $");
#include <sys/param.h>
#include <sys/disk.h>
@@ -271,6 +272,13 @@
return (error);
}
+/*
+ * Actually write the GEOM label to the provider
+ *
+ * @param name GEOM provider's name (ie "ada0")
+ * @param md Pointer to the label data to write
+ * @param size Size of the data pointed to by md
+ */
int
g_metadata_store(const char *name, const unsigned char *md, size_t size)
{
@@ -302,6 +310,7 @@
goto out;
}
bcopy(md, sector, size);
+ bzero(sector + size, sectorsize - size);
if (pwrite(fd, sector, sectorsize, mediasize - sectorsize) !=
sectorsize) {
error = errno;
@@ -336,7 +345,7 @@
goto out;
}
sectorsize = g_sectorsize(fd);
- if (sectorsize == 0) {
+ if (sectorsize <= 0) {
error = errno;
goto out;
}
@@ -365,8 +374,7 @@
}
(void)g_flush(fd);
out:
- if (sector != NULL)
- free(sector);
+ free(sector);
g_close(fd);
return (error);
}
@@ -379,10 +387,15 @@
{
va_list ap;
- if (req->error != NULL)
+ if (req != NULL && req->error != NULL)
return;
va_start(ap, error);
- vasprintf(&req->error, error, ap);
+ if (req != NULL) {
+ vasprintf(&req->error, error, ap);
+ } else {
+ vfprintf(stderr, error, ap);
+ fprintf(stderr, "\n");
+ }
va_end(ap);
}
More information about the Midnightbsd-cvs
mailing list