ash: report reason when a script file could not be opened
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Tue, 22 Aug 2017 20:03:17 +0000 (22:03 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Wed, 23 Aug 2017 12:47:45 +0000 (14:47 +0200)
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>
shell/ash.c

index 703802ff554271bb4e88aedc91264d0795c72f22..a67a453768a2df576985295f4bd17f8283108fa4 100644 (file)
@@ -10575,7 +10575,7 @@ setinputfile(const char *fname, int flags)
                if (flags & INPUT_NOFILE_OK)
                        goto out;
                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)
                fd = savefd(fd);