Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Jan 2016 17:47:57 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r293639 - in user/ngie/stable-10-libnv: lib/libdpv lib/libfigpar sbin/geom/class/part sys/boot/common sys/geom/part sys/sys usr.bin/netstat
Message-ID:  <201601101747.u0AHlvRB097304@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Sun Jan 10 17:47:57 2016
New Revision: 293639
URL: https://svnweb.freebsd.org/changeset/base/293639

Log:
  MFstable/10 @ r293638

Modified:
  user/ngie/stable-10-libnv/lib/libdpv/dialogrc.c
  user/ngie/stable-10-libnv/lib/libdpv/dialogrc.h
  user/ngie/stable-10-libnv/lib/libdpv/util.h
  user/ngie/stable-10-libnv/lib/libfigpar/figpar.3
  user/ngie/stable-10-libnv/lib/libfigpar/figpar.c
  user/ngie/stable-10-libnv/lib/libfigpar/figpar.h
  user/ngie/stable-10-libnv/sbin/geom/class/part/gpart.8
  user/ngie/stable-10-libnv/sys/boot/common/part.c
  user/ngie/stable-10-libnv/sys/geom/part/g_part_gpt.c
  user/ngie/stable-10-libnv/sys/sys/param.h
  user/ngie/stable-10-libnv/usr.bin/netstat/inet.c
Directory Properties:
  user/ngie/stable-10-libnv/   (props changed)

Modified: user/ngie/stable-10-libnv/lib/libdpv/dialogrc.c
==============================================================================
--- user/ngie/stable-10-libnv/lib/libdpv/dialogrc.c	Sun Jan 10 17:44:01 2016	(r293638)
+++ user/ngie/stable-10-libnv/lib/libdpv/dialogrc.c	Sun Jan 10 17:47:57 2016	(r293639)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2013-2014 Devin Teske <dteske@FreeBSD.org>
+ * Copyright (c) 2013-2015 Devin Teske <dteske@FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -49,58 +49,58 @@ char gauge_color[STR_BUFSIZE]	= "47b"; /
 char separator[STR_BUFSIZE]	= "";
 
 /* Function prototypes */
-static int setattr(struct fp_config *, uint32_t, char *, char *);
-static int setbool(struct fp_config *, uint32_t, char *, char *);
-static int setnum(struct fp_config *, uint32_t, char *, char *);
-static int setstr(struct fp_config *, uint32_t, char *, char *);
+static int setattr(struct figpar_config *, uint32_t, char *, char *);
+static int setbool(struct figpar_config *, uint32_t, char *, char *);
+static int setnum(struct figpar_config *, uint32_t, char *, char *);
+static int setstr(struct figpar_config *, uint32_t, char *, char *);
 
 /*
  * Anatomy of DIALOGRC (~/.dialogrc by default)
  * NOTE: Must appear after private function prototypes (above)
  * NB: Brace-initialization of union requires cast to *first* member of union
  */
-static struct fp_config dialogrc_config[] = {
-    /* TYPE        Directive                     DEFAULT        HANDLER */
-    {FP_TYPE_INT,  "aspect",                     {(void *)0},   &setnum},
-    {FP_TYPE_STR,  "separate_widget",            {separator},   &setstr},
-    {FP_TYPE_INT,  "tab_len",                    {(void *)0},   &setnum},
-    {FP_TYPE_BOOL, "visit_items",                {(void *)0},   &setbool},
-    {FP_TYPE_BOOL, "use_shadow",                 {(void *)1},   &setbool},
-    {FP_TYPE_BOOL, "use_colors",                 {(void *)1},   &setbool},
-    {FP_TYPE_STR,  "screen_color",               {NULL},        &setattr},
-    {FP_TYPE_STR,  "shadow_color",               {NULL},        &setattr},
-    {FP_TYPE_STR,  "dialog_color",               {NULL},        &setattr},
-    {FP_TYPE_STR,  "title_color",                {NULL},        &setattr},
-    {FP_TYPE_STR,  "border_color",               {NULL},        &setattr},
-    {FP_TYPE_STR,  "button_active_color",        {NULL},        &setattr},
-    {FP_TYPE_STR,  "button_inactive_color",      {NULL},        &setattr},
-    {FP_TYPE_STR,  "button_key_active_color",    {NULL},        &setattr},
-    {FP_TYPE_STR,  "button_key_inactive_color",  {NULL},        &setattr},
-    {FP_TYPE_STR,  "button_label_active_color",  {NULL},        &setattr},
-    {FP_TYPE_STR,  "button_label_inactive_color",{NULL},        &setattr},
-    {FP_TYPE_STR,  "inputbox_color",             {NULL},        &setattr},
-    {FP_TYPE_STR,  "inputbox_border_color",      {NULL},        &setattr},
-    {FP_TYPE_STR,  "searchbox_color",            {NULL},        &setattr},
-    {FP_TYPE_STR,  "searchbox_title_color",      {NULL},        &setattr},
-    {FP_TYPE_STR,  "searchbox_border_color",     {NULL},        &setattr},
-    {FP_TYPE_STR,  "position_indicator_color",   {NULL},        &setattr},
-    {FP_TYPE_STR,  "menubox_color",              {NULL},        &setattr},
-    {FP_TYPE_STR,  "menubox_border_color",       {NULL},        &setattr},
-    {FP_TYPE_STR,  "item_color",                 {NULL},        &setattr},
-    {FP_TYPE_STR,  "item_selected_color",        {NULL},        &setattr},
-    {FP_TYPE_STR,  "tag_color",                  {NULL},        &setattr},
-    {FP_TYPE_STR,  "tag_selected_color",         {NULL},        &setattr},
-    {FP_TYPE_STR,  "tag_key_color",              {NULL},        &setattr},
-    {FP_TYPE_STR,  "tag_key_selected_color",     {NULL},        &setattr},
-    {FP_TYPE_STR,  "check_color",                {NULL},        &setattr},
-    {FP_TYPE_STR,  "check_selected_color",       {NULL},        &setattr},
-    {FP_TYPE_STR,  "uarrow_color",               {NULL},        &setattr},
-    {FP_TYPE_STR,  "darrow_color",               {NULL},        &setattr},
-    {FP_TYPE_STR,  "itemhelp_color",             {NULL},        &setattr},
-    {FP_TYPE_STR,  "form_active_text_color",     {NULL},        &setattr},
-    {FP_TYPE_STR,  "form_text_color",            {NULL},        &setattr},
-    {FP_TYPE_STR,  "form_item_readonly_color",   {NULL},        &setattr},
-    {FP_TYPE_STR,  "gauge_color",                {gauge_color}, &setattr},
+static struct figpar_config dialogrc_config[] = {
+    /* TYPE            DIRECTIVE                      DEFAULT        HANDLER */
+    {FIGPAR_TYPE_INT,  "aspect",                      {(void *)0},   &setnum},
+    {FIGPAR_TYPE_STR,  "separate_widget",             {separator},   &setstr},
+    {FIGPAR_TYPE_INT,  "tab_len",                     {(void *)0},   &setnum},
+    {FIGPAR_TYPE_BOOL, "visit_items",                 {(void *)0},   &setbool},
+    {FIGPAR_TYPE_BOOL, "use_shadow",                  {(void *)1},   &setbool},
+    {FIGPAR_TYPE_BOOL, "use_colors",                  {(void *)1},   &setbool},
+    {FIGPAR_TYPE_STR,  "screen_color",                {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "shadow_color",                {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "dialog_color",                {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "title_color",                 {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "border_color",                {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "button_active_color",         {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "button_inactive_color",       {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "button_key_active_color",     {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "button_key_inactive_color",   {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "button_label_active_color",   {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "button_label_inactive_color", {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "inputbox_color",              {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "inputbox_border_color",       {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "searchbox_color",             {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "searchbox_title_color",       {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "searchbox_border_color",      {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "position_indicator_color",    {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "menubox_color",               {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "menubox_border_color",        {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "item_color",                  {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "item_selected_color",         {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "tag_color",                   {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "tag_selected_color",          {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "tag_key_color",               {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "tag_key_selected_color",      {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "check_color",                 {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "check_selected_color",        {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "uarrow_color",                {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "darrow_color",                {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "itemhelp_color",              {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "form_active_text_color",      {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "form_text_color",             {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "form_item_readonly_color",    {NULL},        &setattr},
+    {FIGPAR_TYPE_STR,  "gauge_color",                 {gauge_color}, &setattr},
     {0, NULL, {0}, NULL}
 };
 
@@ -108,7 +108,7 @@ static struct fp_config dialogrc_config[
  * figpar call-back for interpreting value as .dialogrc `Attribute'
  */
 static int
-setattr(struct fp_config *option, uint32_t line __unused,
+setattr(struct figpar_config *option, uint32_t line __unused,
     char *directive __unused, char *value)
 {
 	char *cp = value;
@@ -204,7 +204,7 @@ write_attrbuf:
  * figpar call-back for interpreting value as .dialogrc `Boolean'
  */
 static int
-setbool(struct fp_config *option, uint32_t line __unused,
+setbool(struct figpar_config *option, uint32_t line __unused,
     char *directive __unused, char *value)
 {
 
@@ -227,7 +227,7 @@ setbool(struct fp_config *option, uint32
  * figpar call-back for interpreting value as .dialogrc `Number'
  */
 static int
-setnum(struct fp_config *option, uint32_t line __unused,
+setnum(struct figpar_config *option, uint32_t line __unused,
     char *directive __unused, char *value)
 {
 
@@ -247,7 +247,7 @@ setnum(struct fp_config *option, uint32_
  * figpar call-back for interpreting value as .dialogrc `String'
  */
 static int
-setstr(struct fp_config *option, uint32_t line __unused,
+setstr(struct figpar_config *option, uint32_t line __unused,
     char *directive __unused, char *value)
 {
 	size_t len;
@@ -315,7 +315,8 @@ parse_dialogrc(void)
 	}
 
 	/* Process file (either $DIALOGRC if set, or `$HOME/.dialogrc') */
-	res = parse_config(dialogrc_config, path, NULL, FP_BREAK_ON_EQUALS);
+	res = parse_config(dialogrc_config,
+		path, NULL, FIGPAR_BREAK_ON_EQUALS);
 
 	/* Set some globals based on what we parsed */
 	use_shadow = dialogrc_config_option("use_shadow")->value.boolean;
@@ -328,10 +329,10 @@ parse_dialogrc(void)
 
 /*
  * Return a pointer to the `.dialogrc' config option specific to `directive' or
- * static fp_dummy_config (full of NULLs) if none found (see
+ * static figpar_dummy_config (full of NULLs) if none found (see
  * get_config_option(3); part of figpar(3)).
  */
-struct fp_config *
+struct figpar_config *
 dialogrc_config_option(const char *directive)
 {
 	return (get_config_option(dialogrc_config, directive));

Modified: user/ngie/stable-10-libnv/lib/libdpv/dialogrc.h
==============================================================================
--- user/ngie/stable-10-libnv/lib/libdpv/dialogrc.h	Sun Jan 10 17:44:01 2016	(r293638)
+++ user/ngie/stable-10-libnv/lib/libdpv/dialogrc.h	Sun Jan 10 17:47:57 2016	(r293639)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2013-2014 Devin Teske <dteske@FreeBSD.org>
+ * Copyright (c) 2013-2015 Devin Teske <dteske@FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -50,7 +50,7 @@ extern char separator[];
 __BEGIN_DECLS
 void			 dialogrc_free(void);
 int			 parse_dialogrc(void);
-struct fp_config	*dialogrc_config_option(const char *_directive);
+struct figpar_config	*dialogrc_config_option(const char *_directive);
 __END_DECLS
 
 #endif /* !_DIALOGRC_H_ */

Modified: user/ngie/stable-10-libnv/lib/libdpv/util.h
==============================================================================
--- user/ngie/stable-10-libnv/lib/libdpv/util.h	Sun Jan 10 17:44:01 2016	(r293638)
+++ user/ngie/stable-10-libnv/lib/libdpv/util.h	Sun Jan 10 17:47:57 2016	(r293639)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2013-2014 Devin Teske <dteske@FreeBSD.org>
+ * Copyright (c) 2013-2016 Devin Teske <dteske@FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,7 @@
 #define PATH_SHELL	"/bin/sh"
 #endif
 
-#define CMDBUFMAX	4096
+#define CMDBUFMAX	65536
 
 __BEGIN_DECLS
 int	shell_spawn_pipecmd(const char *_cmd, const char *_label, pid_t *_pid);

Modified: user/ngie/stable-10-libnv/lib/libfigpar/figpar.3
==============================================================================
--- user/ngie/stable-10-libnv/lib/libfigpar/figpar.3	Sun Jan 10 17:44:01 2016	(r293638)
+++ user/ngie/stable-10-libnv/lib/libfigpar/figpar.3	Sun Jan 10 17:47:57 2016	(r293639)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd Oct 22, 2015
+.Dd Nov 2, 2015
 .Dt FIGPAR 3
 .Os
 .Sh NAME
@@ -38,13 +38,13 @@
 .In figpar.h
 .Ft int
 .Fo parse_config
-.Fa "struct fp_config options[], const char *path"
-.Fa "int \*[lp]*unknown\*[rp]\*[lp]struct fp_config *option, uint32_t line"
+.Fa "struct figpar_config options[], const char *path"
+.Fa "int \*[lp]*unknown\*[rp]\*[lp]struct figpar_config *option, uint32_t line"
 .Fa "char *directive, char *value\*[rp], uint8_t processing_options"
 .Fc
-.Ft "struct fp_config *"
+.Ft "struct figpar_config *"
 .Fo get_config_option
-.Fa "struct fp_config options[], const char *directive"
+.Fa "struct figpar_config options[], const char *directive"
 .Fc
 .In string_m.h
 .Ft int
@@ -91,32 +91,32 @@ Configuration directives, types, and cal
 data structures defined in
 .In figpar.h :
 .Bd -literal -offset indent
-struct fp_config {
-    enum fp_cfgtype	type;		/* value type */
-    const char		*directive;	/* keyword */
-    union fp_cfgvalue	value;		/* value */
+struct figpar_config {
+    enum figpar_cfgtype		type;		/* value type */
+    const char			*directive;	/* keyword */
+    union figpar_cfgvalue	value;		/* value */
 
     /* Pointer to function used when directive is found */
-    int (*action)(struct fp_config *option, uint32_t line,
+    int (*action)(struct figpar_config *option, uint32_t line,
         char *directive, char *value);
 };
 
-enum fp_cfgtype {
-    FP_TYPE_NONE      = 0x0000, /* for directives with no value */
-    FP_TYPE_BOOL      = 0x0001, /* boolean */
-    FP_TYPE_INT       = 0x0002, /* signed 32 bit integer */
-    FP_TYPE_UINT      = 0x0004, /* unsigned 32 bit integer */
-    FP_TYPE_STR       = 0x0008, /* string pointer */
-    FP_TYPE_STRARRAY  = 0x0010, /* string array pointer */
-    FP_TYPE_DATA1     = 0x0020, /* void data type-1 (whatever) */
-    FP_TYPE_DATA2     = 0x0040, /* void data type-2 (whatever) */
-    FP_TYPE_DATA3     = 0x0080, /* void data type-3 (whatever) */
-    FP_TYPE_RESERVED1 = 0x0100, /* reserved data type-1 (future) */
-    FP_TYPE_RESERVED2 = 0x0200, /* reserved data type-2 (future) */
-    FP_TYPE_RESERVED3 = 0x0400, /* reserved data type-3 (future) */
+enum figpar_cfgtype {
+    FIGPAR_TYPE_NONE      = 0x0000, /* directives with no value */
+    FIGPAR_TYPE_BOOL      = 0x0001, /* boolean */
+    FIGPAR_TYPE_INT       = 0x0002, /* signed 32 bit integer */
+    FIGPAR_TYPE_UINT      = 0x0004, /* unsigned 32 bit integer */
+    FIGPAR_TYPE_STR       = 0x0008, /* string pointer */
+    FIGPAR_TYPE_STRARRAY  = 0x0010, /* string array pointer */
+    FIGPAR_TYPE_DATA1     = 0x0020, /* void data type-1 (open) */
+    FIGPAR_TYPE_DATA2     = 0x0040, /* void data type-2 (open) */
+    FIGPAR_TYPE_DATA3     = 0x0080, /* void data type-3 (open) */
+    FIGPAR_TYPE_RESERVED1 = 0x0100, /* reserved data type-1 */
+    FIGPAR_TYPE_RESERVED2 = 0x0200, /* reserved data type-2 */
+    FIGPAR_TYPE_RESERVED3 = 0x0400, /* reserved data type-3 */
 };
 
-union fp_cfgvalue {
+union figpar_cfgvalue {
     void	*data;      /* Pointer to NUL-terminated string */
     char	*str;       /* Pointer to NUL-terminated string */
     char	**strarray; /* Pointer to an array of strings */
@@ -133,26 +133,26 @@ argument to
 is a mask of bit fields which indicate various
 processing options.
 The possible flags are as follows:
-.Bl -tag -width FP_BREAK_ON_SEMICOLON
-.It Dv FP_BREAK_ON_EQUALS
+.Bl -tag -width FIGPAR_BREAK_ON_SEMICOLON
+.It Dv FIGPAR_BREAK_ON_EQUALS
 An equals sign
 .Pq Ql Li =
 is normally considered part of the directive.
 This flag enables terminating the directive at the equals sign.
 Also makes equals sign optional and transient.
-.It Dv FP_BREAK_ON_SEMICOLON
+.It Dv FIGPAR_BREAK_ON_SEMICOLON
 A semicolon
 .Pq Ql Li \;
 is normally considered part of the value.
 This flag enables terminating the value at the semicolon.
 Also allows multiple statements on a single line separated by semicolon.
-.It Dv FP_CASE_SENSITIVE
+.It Dv FIGPAR_CASE_SENSITIVE
 Normally directives are matched case insensitively using
 .Xr fnmatch 3 .
 This flag enables directive matching to be case sensitive.
-.It Dv FP_REQUIRE_EQUALS
+.It Dv FIGPAR_REQUIRE_EQUALS
 If a directive is not followed by an equals, processing is aborted.
-.It Dv FP_STRICT_EQUALS
+.It Dv FIGPAR_STRICT_EQUALS
 Equals must be part of the directive to be considered a delimiter between
 directive and value.
 .El
@@ -163,14 +163,14 @@ struct array pointer can be NULL and eve
 .Fn unknown
 function argument.
 .Pp
-The directive for each fp_config item in the
+The directive for each figpar_config item in the
 .Fn parse_config
 options argument is matched against each parsed directive using
 .Xr fnmatch 3
 until a match is found.
 If a match is found, the
 .Fn action
-function for that fp_config directive is invoked with the line number,
+function for that figpar_config directive is invoked with the line number,
 directive, and value.
 Otherwise if no match, the
 .Fn unknown
@@ -192,11 +192,11 @@ or if no match a pointer to a static dum
 .Pq whose values are all zero or NULL .
 .Pp
 The use of
-.Fa "struct fp_config"
+.Fa "struct figpar_config"
 is entirely optional as-is the use of
-.Fa "enum fp_cfgtype"
+.Fa "enum figpar_cfgtype"
 or
-.Fa "union fp_cfgvalue" .
+.Fa "union figpar_cfgvalue" .
 For example, you could choose to pass a NULL pointer to
 .Fn parse_config
 for the first argument and then provide a simple

Modified: user/ngie/stable-10-libnv/lib/libfigpar/figpar.c
==============================================================================
--- user/ngie/stable-10-libnv/lib/libfigpar/figpar.c	Sun Jan 10 17:44:01 2016	(r293638)
+++ user/ngie/stable-10-libnv/lib/libfigpar/figpar.c	Sun Jan 10 17:47:57 2016	(r293639)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2002-2014 Devin Teske <dteske@FreeBSD.org>
+ * Copyright (c) 2002-2015 Devin Teske <dteske@FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -40,24 +40,25 @@ __FBSDID("$FreeBSD$");
 #include "figpar.h"
 #include "string_m.h"
 
-struct fp_config fp_dummy_config = {0, NULL, {0}, NULL};
+struct figpar_config figpar_dummy_config = {0, NULL, {0}, NULL};
 
 /*
- * Search for config option (struct fp_config) in the array of config options,
- * returning the struct whose directive matches the given parameter. If no
- * match is found, a pointer to the static dummy array (above) is returned.
+ * Search for config option (struct figpar_config) in the array of config
+ * options, returning the struct whose directive matches the given parameter.
+ * If no match is found, a pointer to the static dummy array (above) is
+ * returned.
  *
  * This is to eliminate dependency on the index position of an item in the
  * array, since the index position is more apt to be changed as code grows.
  */
-struct fp_config *
-get_config_option(struct fp_config options[], const char *directive)
+struct figpar_config *
+get_config_option(struct figpar_config options[], const char *directive)
 {
 	uint32_t n;
 
 	/* Check arguments */
 	if (options == NULL || directive == NULL)
-		return (&fp_dummy_config);
+		return (&figpar_dummy_config);
 
 	/* Loop through the array, return the index of the first match */
 	for (n = 0; options[n].directive != NULL; n++)
@@ -65,12 +66,12 @@ get_config_option(struct fp_config optio
 			return (&(options[n]));
 
 	/* Re-initialize the dummy variable in case it was written to */
-	fp_dummy_config.directive	= NULL;
-	fp_dummy_config.type		= 0;
-	fp_dummy_config.action		= NULL;
-	fp_dummy_config.value.u_num	= 0;
+	figpar_dummy_config.directive	= NULL;
+	figpar_dummy_config.type	= 0;
+	figpar_dummy_config.action	= NULL;
+	figpar_dummy_config.value.u_num	= 0;
 
-	return (&fp_dummy_config);
+	return (&figpar_dummy_config);
 }
 
 /*
@@ -84,9 +85,9 @@ get_config_option(struct fp_config optio
  * Returns zero on success; otherwise returns -1 and errno should be consulted.
 */
 int
-parse_config(struct fp_config options[], const char *path,
-    int (*unknown)(struct fp_config *option, uint32_t line, char *directive,
-    char *value), uint16_t processing_options)
+parse_config(struct figpar_config options[], const char *path,
+    int (*unknown)(struct figpar_config *option, uint32_t line,
+    char *directive, char *value), uint16_t processing_options)
 {
 	uint8_t bequals;
 	uint8_t bsemicolon;
@@ -119,11 +120,15 @@ parse_config(struct fp_config options[],
 		return (-1);
 
 	/* Processing options */
-	bequals = (processing_options & FP_BREAK_ON_EQUALS) == 0 ? 0 : 1;
-	bsemicolon = (processing_options & FP_BREAK_ON_SEMICOLON) == 0 ? 0 : 1;
-	case_sensitive = (processing_options & FP_CASE_SENSITIVE) == 0 ? 0 : 1;
-	require_equals = (processing_options & FP_REQUIRE_EQUALS) == 0 ? 0 : 1;
-	strict_equals = (processing_options & FP_STRICT_EQUALS) == 0 ? 0 : 1;
+	bequals = (processing_options & FIGPAR_BREAK_ON_EQUALS) == 0 ? 0 : 1;
+	bsemicolon =
+		(processing_options & FIGPAR_BREAK_ON_SEMICOLON) == 0 ? 0 : 1;
+	case_sensitive =
+		(processing_options & FIGPAR_CASE_SENSITIVE) == 0 ? 0 : 1;
+	require_equals =
+		(processing_options & FIGPAR_REQUIRE_EQUALS) == 0 ? 0 : 1;
+	strict_equals =
+		(processing_options & FIGPAR_STRICT_EQUALS) == 0 ? 0 : 1;
 
 	/* Initialize strings */
 	directive = value = 0;

Modified: user/ngie/stable-10-libnv/lib/libfigpar/figpar.h
==============================================================================
--- user/ngie/stable-10-libnv/lib/libfigpar/figpar.h	Sun Jan 10 17:44:01 2016	(r293638)
+++ user/ngie/stable-10-libnv/lib/libfigpar/figpar.h	Sun Jan 10 17:47:57 2016	(r293639)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2002-2014 Devin Teske <dteske@FreeBSD.org>
+ * Copyright (c) 2002-2015 Devin Teske <dteske@FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -34,7 +34,7 @@
 /*
  * Union for storing various types of data in a single common container.
  */
-union fp_cfgvalue {
+union figpar_cfgvalue {
 	void		*data;		/* Pointer to NUL-terminated string */
 	char		*str;		/* Pointer to NUL-terminated string */
 	char		**strarray;	/* Pointer to an array of strings */
@@ -46,53 +46,53 @@ union fp_cfgvalue {
 /*
  * Option types (based on above cfgvalue union)
  */
-enum fp_cfgtype {
-	FP_TYPE_NONE		= 0x0000, /* for directives with no value */
-	FP_TYPE_BOOL		= 0x0001, /* boolean */
-	FP_TYPE_INT		= 0x0002, /* signed 32 bit integer */
-	FP_TYPE_UINT		= 0x0004, /* unsigned 32 bit integer */
-	FP_TYPE_STR		= 0x0008, /* string pointer */
-	FP_TYPE_STRARRAY	= 0x0010, /* string array pointer */
-	FP_TYPE_DATA1		= 0x0020, /* void data type-1 (whatever) */
-	FP_TYPE_DATA2		= 0x0040, /* void data type-2 (whatever) */
-	FP_TYPE_DATA3		= 0x0080, /* void data type-3 (whatever) */
-	FP_TYPE_RESERVED1	= 0x0100, /* reserved data type-1 (future) */
-	FP_TYPE_RESERVED2	= 0x0200, /* reserved data type-2 (future) */
-	FP_TYPE_RESERVED3	= 0x0400, /* reserved data type-3 (future) */
+enum figpar_cfgtype {
+	FIGPAR_TYPE_NONE	= 0x0000, /* directives with no value */
+	FIGPAR_TYPE_BOOL	= 0x0001, /* boolean */
+	FIGPAR_TYPE_INT		= 0x0002, /* signed 32 bit integer */
+	FIGPAR_TYPE_UINT	= 0x0004, /* unsigned 32 bit integer */
+	FIGPAR_TYPE_STR		= 0x0008, /* string pointer */
+	FIGPAR_TYPE_STRARRAY	= 0x0010, /* string array pointer */
+	FIGPAR_TYPE_DATA1	= 0x0020, /* void data type-1 (open) */
+	FIGPAR_TYPE_DATA2	= 0x0040, /* void data type-2 (open) */
+	FIGPAR_TYPE_DATA3	= 0x0080, /* void data type-3 (open) */
+	FIGPAR_TYPE_RESERVED1	= 0x0100, /* reserved data type-1 */
+	FIGPAR_TYPE_RESERVED2	= 0x0200, /* reserved data type-2 */
+	FIGPAR_TYPE_RESERVED3	= 0x0400, /* reserved data type-3 */
 };
 
 /*
  * Options to parse_config() for processing_options bitmask
  */
-#define FP_BREAK_ON_EQUALS	0x0001	/* stop reading directive at `=' */
-#define FP_BREAK_ON_SEMICOLON	0x0002	/* `;' starts a new line */
-#define FP_CASE_SENSITIVE	0x0004	/* directives are case sensitive */
-#define FP_REQUIRE_EQUALS	0x0008	/* assignment directives only */
-#define FP_STRICT_EQUALS	0x0010	/* `=' must be part of directive */
+#define FIGPAR_BREAK_ON_EQUALS    0x0001 /* stop reading directive at `=' */
+#define FIGPAR_BREAK_ON_SEMICOLON 0x0002 /* `;' starts a new line */
+#define FIGPAR_CASE_SENSITIVE     0x0004 /* directives are case sensitive */
+#define FIGPAR_REQUIRE_EQUALS     0x0008 /* assignment directives only */
+#define FIGPAR_STRICT_EQUALS      0x0010 /* `=' must be part of directive */
 
 /*
  * Anatomy of a config file option
  */
-struct fp_config {
-	enum fp_cfgtype		type;		/* Option value type */
+struct figpar_config {
+	enum figpar_cfgtype	type;		/* Option value type */
 	const char		*directive;	/* config file keyword */
-	union fp_cfgvalue	value;		/* NB: set by action */
+	union figpar_cfgvalue	value;		/* NB: set by action */
 
 	/*
 	 * Function pointer; action to be taken when the directive is found
 	 */
-	int (*action)(struct fp_config *option, uint32_t line, char *directive,
-	    char *value);
+	int (*action)(struct figpar_config *option, uint32_t line,
+	    char *directive, char *value);
 };
-extern struct fp_config fp_dummy_config;
+extern struct figpar_config figpar_dummy_config;
 
 __BEGIN_DECLS
-int			 parse_config(struct fp_config _options[],
+int			 parse_config(struct figpar_config _options[],
 			    const char *_path,
-			    int (*_unknown)(struct fp_config *_option,
+			    int (*_unknown)(struct figpar_config *_option,
 			    uint32_t _line, char *_directive, char *_value),
 			    uint16_t _processing_options);
-struct fp_config	*get_config_option(struct fp_config _options[],
+struct figpar_config	*get_config_option(struct figpar_config _options[],
 			    const char *_directive);
 __END_DECLS
 

Modified: user/ngie/stable-10-libnv/sbin/geom/class/part/gpart.8
==============================================================================
--- user/ngie/stable-10-libnv/sbin/geom/class/part/gpart.8	Sun Jan 10 17:44:01 2016	(r293638)
+++ user/ngie/stable-10-libnv/sbin/geom/class/part/gpart.8	Sun Jan 10 17:47:57 2016	(r293639)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 14, 2015
+.Dd December 10, 2015
 .Dt GPART 8
 .Os
 .Sh NAME
@@ -1107,15 +1107,6 @@ and
 .Cm recover
 are the only operations allowed on corrupt tables.
 .Pp
-If the first sector of a provider is corrupt, the kernel can not detect GPT
-even if the partition table itself is not corrupt.
-The protective MBR can be rewritten using the
-.Xr dd 1
-command, to restore the ability to detect the GPT.
-The copy of the protective MBR is usually located in the
-.Pa /boot/pmbr
-file.
-.Pp
 If one GPT header appears to be corrupt but the other copy remains intact,
 the kernel will log the following:
 .Bd -literal -offset indent
@@ -1330,7 +1321,6 @@ and
 /sbin/gpart backup ada0 | /sbin/gpart restore -F ada1 ada2
 .Ed
 .Sh SEE ALSO
-.Xr dd 1 ,
 .Xr geom 4 ,
 .Xr boot0cfg 8 ,
 .Xr geom 8 ,

Modified: user/ngie/stable-10-libnv/sys/boot/common/part.c
==============================================================================
--- user/ngie/stable-10-libnv/sys/boot/common/part.c	Sun Jan 10 17:44:01 2016	(r293638)
+++ user/ngie/stable-10-libnv/sys/boot/common/part.c	Sun Jan 10 17:47:57 2016	(r293639)
@@ -306,6 +306,7 @@ ptable_gptread(struct ptable *table, voi
 		table->type = PTABLE_NONE;
 		goto out;
 	}
+	DEBUG("GPT detected");
 	size = MIN(hdr.hdr_entries * hdr.hdr_entsz,
 	    MAXTBLSZ * table->sectorsize);
 	for (i = 0; i < size / hdr.hdr_entsz; i++) {
@@ -631,6 +632,11 @@ ptable_open(void *dev, off_t sectors, ui
 	if (buf[DOSMAGICOFFSET] != 0x55 ||
 	    buf[DOSMAGICOFFSET + 1] != 0xaa) {
 		DEBUG("magic sequence not found");
+#if defined(LOADER_GPT_SUPPORT)
+		/* There is no PMBR, check that we have backup GPT */
+		table->type = PTABLE_GPT;
+		table = ptable_gptread(table, dev, dread);
+#endif
 		goto out;
 	}
 	/* Check that we have PMBR. Also do some validation. */

Modified: user/ngie/stable-10-libnv/sys/geom/part/g_part_gpt.c
==============================================================================
--- user/ngie/stable-10-libnv/sys/geom/part/g_part_gpt.c	Sun Jan 10 17:44:01 2016	(r293638)
+++ user/ngie/stable-10-libnv/sys/geom/part/g_part_gpt.c	Sun Jan 10 17:47:57 2016	(r293639)
@@ -823,22 +823,23 @@ g_part_gpt_probe(struct g_part_table *ta
 		return (error);
 	res = le16dec(buf + DOSMAGICOFFSET);
 	pri = G_PART_PROBE_PRI_LOW;
-	for (index = 0; index < NDOSPART; index++) {
-		if (buf[DOSPARTOFF + DOSPARTSIZE * index + 4] == 0xee)
-			pri = G_PART_PROBE_PRI_HIGH;
-	}
-	g_free(buf);
-	if (res != DOSMAGIC) 
-		return (ENXIO);
+	if (res == DOSMAGIC) {
+		for (index = 0; index < NDOSPART; index++) {
+			if (buf[DOSPARTOFF + DOSPARTSIZE * index + 4] == 0xee)
+				pri = G_PART_PROBE_PRI_HIGH;
+		}
+		g_free(buf);
 
-	/* Check that there's a primary header. */
-	buf = g_read_data(cp, pp->sectorsize, pp->sectorsize, &error);
-	if (buf == NULL)
-		return (error);
-	res = memcmp(buf, GPT_HDR_SIG, 8);
-	g_free(buf);
-	if (res == 0)
-		return (pri);
+		/* Check that there's a primary header. */
+		buf = g_read_data(cp, pp->sectorsize, pp->sectorsize, &error);
+		if (buf == NULL)
+			return (error);
+		res = memcmp(buf, GPT_HDR_SIG, 8);
+		g_free(buf);
+		if (res == 0)
+			return (pri);
+	} else
+		g_free(buf);
 
 	/* No primary? Check that there's a secondary. */
 	buf = g_read_data(cp, pp->mediasize - pp->sectorsize, pp->sectorsize,

Modified: user/ngie/stable-10-libnv/sys/sys/param.h
==============================================================================
--- user/ngie/stable-10-libnv/sys/sys/param.h	Sun Jan 10 17:44:01 2016	(r293638)
+++ user/ngie/stable-10-libnv/sys/sys/param.h	Sun Jan 10 17:47:57 2016	(r293639)
@@ -58,7 +58,7 @@
  *		in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1002507	/* Master, propagated to newvers */
+#define __FreeBSD_version 1002508	/* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,

Modified: user/ngie/stable-10-libnv/usr.bin/netstat/inet.c
==============================================================================
--- user/ngie/stable-10-libnv/usr.bin/netstat/inet.c	Sun Jan 10 17:44:01 2016	(r293638)
+++ user/ngie/stable-10-libnv/usr.bin/netstat/inet.c	Sun Jan 10 17:47:57 2016	(r293639)
@@ -1039,47 +1039,6 @@ icmp_stats(u_long off, const char *name,
 	}
 }
 
-#ifndef BURN_BRIDGES
-/*
- * Dump IGMP statistics structure (pre 8.x kernel).
- */
-static void
-igmp_stats_live_old(const char *name)
-{
-	struct oigmpstat oigmpstat, zerostat;
-	size_t len = sizeof(oigmpstat);
-
-	if (zflag)
-		memset(&zerostat, 0, len);
-	if (sysctlbyname("net.inet.igmp.stats", &oigmpstat, &len,
-	    zflag ? &zerostat : NULL, zflag ? len : 0) < 0) {
-		warn("sysctl: net.inet.igmp.stats");
-		return;
-	}
-
-	printf("%s:\n", name);
-
-#define	p(f, m) if (oigmpstat.f || sflag <= 1) \
-    printf(m, oigmpstat.f, plural(oigmpstat.f))
-#define	py(f, m) if (oigmpstat.f || sflag <= 1) \
-    printf(m, oigmpstat.f, oigmpstat.f != 1 ? "ies" : "y")
-	p(igps_rcv_total, "\t%u message%s received\n");
-	p(igps_rcv_tooshort, "\t%u message%s received with too few bytes\n");
-	p(igps_rcv_badsum, "\t%u message%s received with bad checksum\n");
-	py(igps_rcv_queries, "\t%u membership quer%s received\n");
-	py(igps_rcv_badqueries,
-	    "\t%u membership quer%s received with invalid field(s)\n");
-	p(igps_rcv_reports, "\t%u membership report%s received\n");
-	p(igps_rcv_badreports,
-	    "\t%u membership report%s received with invalid field(s)\n");
-	p(igps_rcv_ourreports,
-"\t%u membership report%s received for groups to which we belong\n");
-        p(igps_snd_reports, "\t%u membership report%s sent\n");
-#undef p
-#undef py
-}
-#endif /* !BURN_BRIDGES */
-
 /*
  * Dump IGMP statistics structure.
  */



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