ash: report reason when a script file could not be opened

It is always nicer to give the user some sort of indication why an
operation failed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Johannes Schindelin 2017-08-22 22:03:17 +02:00 committed by Denys Vlasenko
parent 6bafcfb67a
commit 20a63b2c18

View File

@ -10575,7 +10575,7 @@ setinputfile(const char *fname, int flags)
if (flags & INPUT_NOFILE_OK) if (flags & INPUT_NOFILE_OK)
goto out; goto out;
exitstatus = 127; exitstatus = 127;
ash_msg_and_raise_error("can't open '%s'", fname); ash_msg_and_raise_perror("can't open '%s'", fname);
} }
if (fd < 10) if (fd < 10)
fd = savefd(fd); fd = savefd(fd);