summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ikectl/ikeca.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/ikectl/ikeca.c')
-rw-r--r--usr.sbin/ikectl/ikeca.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/ikectl/ikeca.c b/usr.sbin/ikectl/ikeca.c
index de4a9032e6a..c66fbb65cd4 100644
--- a/usr.sbin/ikectl/ikeca.c
+++ b/usr.sbin/ikectl/ikeca.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ikeca.c,v 1.26 2014/04/18 21:29:20 tedu Exp $ */
+/* $OpenBSD: ikeca.c,v 1.27 2014/07/20 01:38:40 guenther Exp $ */
/*
* Copyright (c) 2010 Jonathan Gray <jsg@openbsd.org>
@@ -473,8 +473,9 @@ fcopy(char *src, char *dst, mode_t mode)
err(1, "open %s", src);
if ((ofd = open(dst, O_WRONLY|O_CREAT|O_TRUNC, mode)) == -1) {
+ int saved_errno = errno;
close(ifd);
- err(1, "open %s", dst);
+ errc(1, saved_errno, "open %s", dst);
}
while ((r = read(ifd, buf, sizeof(buf))) > 0) {