summaryrefslogtreecommitdiffstats
path: root/usr.bin/tftp/main.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-11-11 01:12:09 +0000
committerderaadt <deraadt@openbsd.org>2015-11-11 01:12:09 +0000
commitf24baa2d4873123677fed51a2a9394a68863de40 (patch)
tree2f090abc16569cd9e97f83d95ee2809ea2a42ba6 /usr.bin/tftp/main.c
parentupdate NAME section to include all documented functions, (diff)
downloadwireguard-openbsd-f24baa2d4873123677fed51a2a9394a68863de40.tar.xz
wireguard-openbsd-f24baa2d4873123677fed51a2a9394a68863de40.zip
creat() -> open equiv; from Frederic Nowak
Diffstat (limited to 'usr.bin/tftp/main.c')
-rw-r--r--usr.bin/tftp/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tftp/main.c b/usr.bin/tftp/main.c
index eaeaefdac3e..e653b8aefcf 100644
--- a/usr.bin/tftp/main.c
+++ b/usr.bin/tftp/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.38 2015/10/18 03:54:22 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.39 2015/11/11 01:12:10 deraadt Exp $ */
/* $NetBSD: main.c,v 1.6 1995/05/21 16:54:10 mycroft Exp $ */
/*
@@ -473,7 +473,7 @@ get(int argc, char *argv[])
}
if (argc < 4) {
cp = argc == 3 ? argv[2] : tail(src);
- fd = creat(cp, 0644);
+ fd = open(cp, O_CREAT | O_TRUNC | O_WRONLY, 0644);
if (fd < 0) {
warn("create: %s", cp);
return;
@@ -485,7 +485,7 @@ get(int argc, char *argv[])
break;
}
cp = tail(src); /* new .. jdg */
- fd = creat(cp, 0644);
+ fd = open(cp, O_CREAT | O_TRUNC | O_WRONLY, 0644);
if (fd < 0) {
warn("create: %s", cp);
continue;