summaryrefslogtreecommitdiff
path: root/usr.bin/indent/indent.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-11-11 01:12:11 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-11-11 01:12:11 +0000
commitdf8ebf4c4a153005ea56888d82e05288c597b4dc (patch)
treec0eb870a47c4f73e3880ed05eb2ca1d61294ea89 /usr.bin/indent/indent.c
parent4a35cd787d4211704bc33e641f746562a95af113 (diff)
creat() -> open equiv; from Frederic Nowak
Diffstat (limited to 'usr.bin/indent/indent.c')
-rw-r--r--usr.bin/indent/indent.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/indent/indent.c b/usr.bin/indent/indent.c
index 13ff0d2e887..951f03f5442 100644
--- a/usr.bin/indent/indent.c
+++ b/usr.bin/indent/indent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: indent.c,v 1.29 2015/10/09 01:37:07 deraadt Exp $ */
+/* $OpenBSD: indent.c,v 1.30 2015/11/11 01:12:09 deraadt Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -1184,7 +1184,7 @@ bakcopy(void)
errc(1, ENAMETOOLONG, "%s.BAK", p);
/* copy in_name to backup file */
- bakchn = creat(bakfile, 0600);
+ bakchn = open(bakfile, O_CREAT | O_TRUNC | O_WRONLY, 0600);
if (bakchn < 0)
err(1, "%s", bakfile);
while ((n = read(fileno(input), buff, sizeof buff)) > 0)