@@ -3476,7 +3476,7 @@ spawn_daemon(void)
3476
3476
pid = fork ();
3477
3477
switch (pid ) {
3478
3478
case -1 :
3479
- fprintf (stderr , "failed to fork daemon\n" );
3479
+ fprintf (stderr , "Failed to fork daemon\n" );
3480
3480
return - BFDEV_EFAULT ;
3481
3481
3482
3482
case 0 :
@@ -3488,27 +3488,27 @@ spawn_daemon(void)
3488
3488
3489
3489
fd = open ("/dev/null" , O_RDWR );
3490
3490
if (fd < 0 ) {
3491
- fprintf (stderr , "failed to open null\n" );
3491
+ fprintf (stderr , "Failed to open null\n" );
3492
3492
return - BFDEV_ENXIO ;
3493
3493
}
3494
3494
3495
3495
if (isatty (STDIN_FILENO )) {
3496
3496
if (dup2 (fd , STDIN_FILENO ) < 0 ) {
3497
- fprintf (stderr , "failed to dup stdin\n" );
3497
+ fprintf (stderr , "Failed to dup stdin\n" );
3498
3498
return - BFDEV_ENXIO ;
3499
3499
}
3500
3500
}
3501
3501
3502
3502
if (isatty (STDOUT_FILENO )) {
3503
3503
if (dup2 (fd , STDOUT_FILENO ) < 0 ) {
3504
- fprintf (stderr , "failed to dup stdout\n" );
3504
+ fprintf (stderr , "Failed to dup stdout\n" );
3505
3505
return - BFDEV_ENXIO ;
3506
3506
}
3507
3507
}
3508
3508
3509
3509
if (isatty (STDERR_FILENO )) {
3510
3510
if (dup2 (fd , STDERR_FILENO ) < 0 ) {
3511
- fprintf (stderr , "failed to dup stdout\n" );
3511
+ fprintf (stderr , "Failed to dup stdout\n" );
3512
3512
return - BFDEV_ENXIO ;
3513
3513
}
3514
3514
}
@@ -3591,6 +3591,7 @@ main(int argc, char *const argv[])
3591
3591
{
3592
3592
unsigned long value ;
3593
3593
int arg , optidx , logfd ;
3594
+ struct stat stbuf ;
3594
3595
int retval ;
3595
3596
3596
3597
logfd = -1 ;
@@ -3679,6 +3680,11 @@ main(int argc, char *const argv[])
3679
3680
if (!sdbd_shell )
3680
3681
sdbd_shell = "/bin/sh" ;
3681
3682
3683
+ if (stat (sdbd_shell , & stbuf )) {
3684
+ fprintf (stderr , "Shell interpreter not found: '%s'\n" , sdbd_shell );
3685
+ exit (1 );
3686
+ }
3687
+
3682
3688
if (sdbd_daemon ) {
3683
3689
retval = spawn_daemon ();
3684
3690
if (retval < 0 )
0 commit comments