summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pw/pw_user.c
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2015-07-11 20:18:34 +0000
committerbapt <bapt@FreeBSD.org>2015-07-11 20:18:34 +0000
commit1f1e46ef86c25f5ac981d502a33eb1e9ca2767ad (patch)
treebf79e3ef1623ef8b03e597d9ea702bfbb55ef316 /usr.sbin/pw/pw_user.c
parent726705189794b7625e3e5e7258a2ab4eab18c10a (diff)
downloadFreeBSD-src-1f1e46ef86c25f5ac981d502a33eb1e9ca2767ad.zip
FreeBSD-src-1f1e46ef86c25f5ac981d502a33eb1e9ca2767ad.tar.gz
Remove useless use of goto
Diffstat (limited to 'usr.sbin/pw/pw_user.c')
-rw-r--r--usr.sbin/pw/pw_user.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c
index b9d01a8..7e8534e 100644
--- a/usr.sbin/pw/pw_user.c
+++ b/usr.sbin/pw/pw_user.c
@@ -400,7 +400,7 @@ pw_user(int mode, char *name, long id, struct cargs * args)
*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, struct cargs * args)
}
}
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))
OpenPOWER on IntegriCloud