diff --git a/histrap.c b/histrap.c index 940c879..6e08c84 100644 --- a/histrap.c +++ b/histrap.c @@ -1,5 +1,5 @@ -/** $MirOS: src/bin/mksh/histrap.c,v 1.10 2005/07/07 23:27:52 tg Exp $ */ -/* $OpenBSD: history.c,v 1.30 2005/03/30 17:16:37 deraadt Exp $ */ +/** $MirOS: src/bin/mksh/histrap.c,v 1.11 2005/08/02 12:26:17 tg Exp $ */ +/* $OpenBSD: history.c,v 1.31 2005/07/31 16:12:52 espie Exp $ */ /* $OpenBSD: trap.c,v 1.22 2005/03/30 17:16:37 deraadt Exp $ */ #include "sh.h" @@ -7,7 +7,7 @@ #include #include -__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.10 2005/07/07 23:27:52 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/histrap.c,v 1.11 2005/08/02 12:26:17 tg Exp $"); static int histfd; static int hsize; @@ -773,7 +773,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)) {