diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2006-03-17 16:30:14 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2006-03-17 16:30:14 +0000 |
commit | 545662306a341986faab81d8a2adb54b559c6830 (patch) | |
tree | 3c5e3664174a1c48bbb24f80a3810b68c133026f /bin/ksh/history.c | |
parent | 655efa37b5c8313ced96c25d2ed9b4346d8837fa (diff) |
Simplify savefd() by removing the "noclose" flag and make noclose
behavior the default. Almost all uses of savefd() are followed
by an implicit or explicit close. OK otto@
Diffstat (limited to 'bin/ksh/history.c')
-rw-r--r-- | bin/ksh/history.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/ksh/history.c b/bin/ksh/history.c index 7b959455f95..bcd7ee6fbf3 100644 --- a/bin/ksh/history.c +++ b/bin/ksh/history.c @@ -1,4 +1,4 @@ -/* $OpenBSD: history.c,v 1.33 2006/03/12 00:26:58 deraadt Exp $ */ +/* $OpenBSD: history.c,v 1.34 2006/03/17 16:30:13 millert Exp $ */ /* * command history @@ -646,7 +646,9 @@ hist_init(Source *s) if ((fd = open(hname, O_RDWR|O_CREAT|O_APPEND, 0600)) < 0) return; - histfd = savefd(fd, 0); + histfd = savefd(fd); + if (histfd != fd) + close(fd); (void) flock(histfd, LOCK_EX); |