Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Problem with zkbd



On Jun 7, 10:03pm, Richard Hartmann wrote:
}
} > bash: cannot create temp file for here document: Permission denied
} 
} May I suggest changing the error message to be more verbose?

I think the reason it's not more verbose already is, given the way the
code is structured, it might be an error opening, writing, or closing
the file, and we don't know which.

However, we can probably fudge it in the same way bash seems to have.  In
fact, we should emit the error a bit sooner to prevent other possible
errors from changing errno.

Index: Src/exec.c
--- ../zsh-forge/current/Src/exec.c	2008-05-11 13:01:14.000000000 -0700
+++ Src/exec.c	2008-06-07 13:32:40.000000000 -0700
@@ -2736,10 +2736,11 @@
 		else
 		    fil = getherestr(fn);
 		if (fil == -1) {
+		    if (errno && errno != EINTR)
+			zwarn("can't create temp file for here document: %e",
+			      errno);
 		    closemnodes(mfds);
 		    fixfds(save);
-		    if (errno && errno != EINTR)
-			zwarn("%e", errno);
 		    execerr();
 		}
 		addfd(forked, save, mfds, fn->fd1, fil, 0, fn->varid);



Messages sorted by: Reverse Date, Date, Thread, Author