summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2005-07-31 16:12:53 +0000
committerMarc Espie <espie@cvs.openbsd.org>2005-07-31 16:12:53 +0000
commit2a4c2c7365b0f85e502574ff37bcafc8dae6fafb (patch)
tree6bcd0f2d2a8e3317ecb204386103ee5bf37bd7f6 /bin
parent241fd2f0a26ebbd20276774f7db20f11938b6948 (diff)
say goodbye to creat().
okay deraadt@
Diffstat (limited to 'bin')
-rw-r--r--bin/ksh/history.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/ksh/history.c b/bin/ksh/history.c
index 6198e56d027..339a4d95de0 100644
--- a/bin/ksh/history.c
+++ b/bin/ksh/history.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: history.c,v 1.30 2005/03/30 17:16:37 deraadt Exp $ */
+/* $OpenBSD: history.c,v 1.31 2005/07/31 16:12:52 espie Exp $ */
/*
* command history
@@ -760,7 +760,7 @@ hist_shrink(unsigned char *oldbase, int oldbytes)
* create temp file
*/
(void) shf_snprintf(nfile, sizeof(nfile), "%s.%d", hname, procpid);
- if ((fd = creat(nfile, 0600)) < 0)
+ if ((fd = open(nfile, O_CREAT | O_TRUNC | O_WRONLY, 0600)) < 0)
return 1;
if (sprinkle(fd)) {