Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Jan 2014 19:40:20 -0800
From:      Garrett Cooper <yaneurabeya@gmail.com>
To:        FreeBSD-gnats-submit@FreeBSD.org, freebsd-bugs@FreeBSD.org
Subject:   Re: bin/185648: fmtree is unnecessarily noisy
Message-ID:  <E978F949-E613-4B7C-AF50-221F7C24A9A3@gmail.com>
In-Reply-To: <201401102200.s0AM01qp093493@freefall.freebsd.org>
References:  <201401102200.s0AM01qp093493@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
	Doing some code inspection, the noise is benign but not human friendly. This patch should make it a little more human-friendly.
Thanks,
-Garrett

[-- Attachment #2 --]
From a3e0cf67fab89883913fe516907ab0af7883164e Mon Sep 17 00:00:00 2001
From: Garrett Cooper <yanegomi@gmail.com>
Date: Mon, 13 Jan 2014 09:48:27 -0800
Subject: [PATCH] make the message when EEXIST occurs with mkdir(2) more
 meaningful

---
 usr.sbin/mtree/verify.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/usr.sbin/mtree/verify.c b/usr.sbin/mtree/verify.c
index b7c4fd9..f708846 100644
--- a/usr.sbin/mtree/verify.c
+++ b/usr.sbin/mtree/verify.c
@@ -218,8 +218,11 @@ miss(NODE *p, char *tail)
 			} else if (!(p->flags & F_MODE))
 			    (void)printf(" (directory not created: mode not specified)");
 			else if (mkdir(path, S_IRWXU))
-				(void)printf(" (directory not created: %s)",
-				    strerror(errno));
+				if (errno == EEXIST)
+					(void)printf(" (path already exists)");
+				else
+					(void)printf(" (directory not created: %s)",
+					    strerror(errno));
 			else {
 				create = 1;
 				(void)printf(" (created)");
-- 
1.8.4.1


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E978F949-E613-4B7C-AF50-221F7C24A9A3>