Skip to content

Commit f4dcda1

Browse files
committed
feat shell: added more detail interpreter check
Signed-off-by: John Sanpe <sanpeqf@gmail.com>
1 parent f264269 commit f4dcda1

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

sdbd.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4018,7 +4018,6 @@ main(int argc, char *const argv[])
40184018
{
40194019
unsigned long value;
40204020
int arg, optidx, logfd;
4021-
struct stat stbuf;
40224021
int retval;
40234022

40244023
logfd = -1;
@@ -4107,8 +4106,8 @@ main(int argc, char *const argv[])
41074106
if (!sdbd_shell)
41084107
sdbd_shell = "/bin/sh";
41094108

4110-
if (stat(sdbd_shell, &stbuf)) {
4111-
fprintf(stderr, "Shell interpreter not found: '%s'\n", sdbd_shell);
4109+
if (access(sdbd_shell, X_OK)) {
4110+
fprintf(stderr, "Shell interpreter error: '%s' (%m)\n", sdbd_shell);
41124111
exit(1);
41134112
}
41144113

0 commit comments

Comments
 (0)