diff options
author | tobias <tobias@openbsd.org> | 2014-11-25 10:20:24 +0000 |
---|---|---|
committer | tobias <tobias@openbsd.org> | 2014-11-25 10:20:24 +0000 |
commit | 0d86349cb6322f8fa52fef497fba1406412690c7 (patch) | |
tree | a3933ffa522040339d825d2b22b147a25227722d /usr.bin/paste | |
parent | use correct divisor when converting microseconds to 100ths of a second (diff) | |
download | wireguard-openbsd-0d86349cb6322f8fa52fef497fba1406412690c7.tar.xz wireguard-openbsd-0d86349cb6322f8fa52fef497fba1406412690c7.zip |
Release file descriptors as soon as they are not needed anymore.
ok millert
Diffstat (limited to 'usr.bin/paste')
-rw-r--r-- | usr.bin/paste/paste.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/paste/paste.c b/usr.bin/paste/paste.c index eeec15d5544..8bf14f8b1fb 100644 --- a/usr.bin/paste/paste.c +++ b/usr.bin/paste/paste.c @@ -1,4 +1,4 @@ -/* $OpenBSD: paste.c,v 1.18 2010/08/12 05:02:52 tedu Exp $ */ +/* $OpenBSD: paste.c,v 1.19 2014/11/25 10:20:24 tobias Exp $ */ /* * Copyright (c) 1989 The Regents of the University of California. @@ -130,6 +130,8 @@ parallel(char **argv) if (!(buf = fgetln(lp->fp, &len))) { if (!--opencnt) break; + if (lp->fp != stdin) + (void)fclose(lp->fp); lp->fp = NULL; if (output && lp->cnt && (ch = delim[(lp->cnt - 1) % delimcnt])) |