Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/dkwedge Be less noisy when handling wedge name confl...



details:   https://anonhg.NetBSD.org/src/rev/618dd743c757
branches:  trunk
changeset: 333433:618dd743c757
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Tue Nov 04 07:43:00 2014 +0000

description:
Be less noisy when handling wedge name conflicts.

diffstat:

 sys/dev/dkwedge/dkwedge_gpt.c |  16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diffs (39 lines):

diff -r f8fa0d7aab54 -r 618dd743c757 sys/dev/dkwedge/dkwedge_gpt.c
--- a/sys/dev/dkwedge/dkwedge_gpt.c     Tue Nov 04 07:41:37 2014 +0000
+++ b/sys/dev/dkwedge/dkwedge_gpt.c     Tue Nov 04 07:43:00 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dkwedge_gpt.c,v 1.13 2014/10/18 08:33:27 snj Exp $     */
+/*     $NetBSD: dkwedge_gpt.c,v 1.14 2014/11/04 07:43:00 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dkwedge_gpt.c,v 1.13 2014/10/18 08:33:27 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dkwedge_gpt.c,v 1.14 2014/11/04 07:43:00 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -265,13 +265,15 @@
                 * Try with the partition name first.  If that fails,
                 * use the GUID string.  If that fails, punt.
                 */
-               if ((error = dkwedge_add(&dkw)) == EEXIST) {
-                       aprint_error("%s: wedge named '%s' already exists, "
-                           "trying '%s'\n", pdk->dk_name,
-                           dkw.dkw_wname, /* XXX Unicode */
-                           ent_guid_str);
+               if ((error = dkwedge_add(&dkw)) == EEXIST &&
+                   strcmp(dkw.dkw_wname, ent_guid_str) != 0) {
                        strcpy(dkw.dkw_wname, ent_guid_str);
                        error = dkwedge_add(&dkw);
+                       if (!error)
+                               aprint_error("%s: wedge named '%s' already "
+                                   "existed, using '%s'\n", pdk->dk_name,
+                                   dkw.dkw_wname, /* XXX Unicode */
+                                   ent_guid_str);
                }
                if (error == EEXIST)
                        aprint_error("%s: wedge named '%s' already exists, "



Home | Main Index | Thread Index | Old Index