summaryrefslogtreecommitdiffstats
path: root/pw/grupd.c
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-10-31 19:02:42 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-10-31 19:02:42 +0000
commit60c1d0610047dcd45e98e6af3a8b69fd1dcf45d7 (patch)
tree568796d378b9962fc7a08cba2b8167f797aa4f35 /pw/grupd.c
parentf317f6f160126ebac2b8a392dc9a59e65ef2b928 (diff)
parenteaf8d4a9d903595d2f3a388ed56fd20b34d9f80b (diff)
downloadpw-darwin-60c1d0610047dcd45e98e6af3a8b69fd1dcf45d7.tar.gz
pw-darwin-60c1d0610047dcd45e98e6af3a8b69fd1dcf45d7.zip
Merge ^/head r307736 through r308146.
Diffstat (limited to 'pw/grupd.c')
-rw-r--r--pw/grupd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pw/grupd.c b/pw/grupd.c
index 9cbe0cb..38d5e5b 100644
--- a/pw/grupd.c
+++ b/pw/grupd.c
@@ -34,6 +34,7 @@ static const char rcsid[] =
#include <libutil.h>
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
#include "pwupd.h"
@@ -73,8 +74,10 @@ gr_update(struct group * grp, char const * group)
}
if (gr_copy(pfd, tfd, gr, old_gr) == -1) {
gr_fini();
+ close(tfd);
err(1, "gr_copy()");
}
+ close(tfd);
if (gr_mkdb() == -1) {
gr_fini();
err(1, "gr_mkdb()");