diff options
author | 2001-09-17 04:42:55 +0000 | |
---|---|---|
committer | 2001-09-17 04:42:55 +0000 | |
commit | 2aade64dcb6ecc3f5c5c229e45208769e23c0df9 (patch) | |
tree | 869f7d98e35da90a95042cbdf02093d2e40e8e1a | |
parent | stuff for ksyms (doesn't quite work yet, tho) (diff) | |
download | wireguard-openbsd-2aade64dcb6ecc3f5c5c229e45208769e23c0df9.tar.xz wireguard-openbsd-2aade64dcb6ecc3f5c5c229e45208769e23c0df9.zip |
make vi exit if it can't create a temp file. From NetBSD, ok millert
-rw-r--r-- | usr.bin/vi/common/exf.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/vi/common/exf.c b/usr.bin/vi/common/exf.c index d2b361d9f8b..4951ee385b1 100644 --- a/usr.bin/vi/common/exf.c +++ b/usr.bin/vi/common/exf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exf.c,v 1.13 2001/06/18 21:39:25 millert Exp $ */ +/* $OpenBSD: exf.c,v 1.14 2001/09/17 04:42:55 pvalchev Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -185,6 +185,11 @@ file_init(sp, frp, rcv_name, flags) */ oname = frp->name; if (LF_ISSET(FS_OPENERR) || oname == NULL || !exists) { + /* + * Don't try to create a temporary support file twice. + */ + if (frp->tname != NULL) + goto err; if (opts_empty(sp, O_DIRECTORY, 0)) goto err; (void)snprintf(tname, sizeof(tname), |