Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Jul 2015 20:18:35 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r285406 - head/usr.sbin/pw
Message-ID:  <201507112018.t6BKIZtZ088817@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Sat Jul 11 20:18:34 2015
New Revision: 285406
URL: https://svnweb.freebsd.org/changeset/base/285406

Log:
  Remove useless use of goto

Modified:
  head/usr.sbin/pw/pw_user.c

Modified: head/usr.sbin/pw/pw_user.c
==============================================================================
--- head/usr.sbin/pw/pw_user.c	Sat Jul 11 20:10:12 2015	(r285405)
+++ head/usr.sbin/pw/pw_user.c	Sat Jul 11 20:18:34 2015	(r285406)
@@ -400,7 +400,7 @@ pw_user(int mode, char *name, long id, s
 					*p = '\0';
 					if (stat(dbuf, &st) == -1) {
 						if (mkdir(dbuf, _DEF_DIRMODE) == -1)
-							goto direrr;
+							err(EX_OSFILE, "mkdir '%s'", dbuf);
 						chown(dbuf, 0, 0);
 					} else if (!S_ISDIR(st.st_mode))
 						errx(EX_OSFILE, "'%s' (root home parent) is not a directory", dbuf);
@@ -408,9 +408,8 @@ pw_user(int mode, char *name, long id, s
 				}
 			}
 			if (stat(dbuf, &st) == -1) {
-				if (mkdir(dbuf, _DEF_DIRMODE) == -1) {
-				direrr:	err(EX_OSFILE, "mkdir '%s'", dbuf);
-				}
+				if (mkdir(dbuf, _DEF_DIRMODE) == -1)
+					err(EX_OSFILE, "mkdir '%s'", dbuf);
 				chown(dbuf, 0, 0);
 			}
 		} else if (!S_ISDIR(st.st_mode))



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