summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortb <tb@openbsd.org>2016-01-01 20:55:13 +0000
committertb <tb@openbsd.org>2016-01-01 20:55:13 +0000
commit899494aee0258487b5115529307ca70ce698066b (patch)
treef7c0644b45af4c4ab1fa84a68be0a4a65971cf52
parentThe pointer buf is a user space string which was directly passed (diff)
downloadwireguard-openbsd-899494aee0258487b5115529307ca70ce698066b.tar.xz
wireguard-openbsd-899494aee0258487b5115529307ca70ce698066b.zip
Improve error message for sed -i by appending strerror(errno).
From Michael Reed, thanks! ok deraadt@
-rw-r--r--usr.bin/sed/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/sed/main.c b/usr.bin/sed/main.c
index 473995567f7..cd42171d5f8 100644
--- a/usr.bin/sed/main.c
+++ b/usr.bin/sed/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.30 2015/10/26 22:22:56 jca Exp $ */
+/* $OpenBSD: main.c,v 1.31 2016/01/01 20:55:13 tb Exp $ */
/*-
* Copyright (c) 1992 Diomidis Spinellis.
@@ -374,7 +374,7 @@ mf_fgets(SPACE *sp, enum e_spflag spflag)
if (len >= sizeof(tmpfname))
error(FATAL, "%s: name too long", fname);
if ((fd = mkstemp(tmpfname)) == -1)
- error(FATAL, "%s", fname);
+ error(FATAL, "%s: %s", fname, strerror(errno));
if ((outfile = fdopen(fd, "w")) == NULL) {
unlink(tmpfname);
error(FATAL, "%s", fname);