PR gdb/28369 reports that gdb/ser-pipe.c has an 'execl' function call
with a hard-coded "/bin/sh" as its argument. We've had 'get_shell'
for a while now, which is conscious about the SHELL environment and a
better alternative to always calling "/bin/sh".
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28369
#include "gdbsupport/gdb_sys_time.h"
#include <fcntl.h>
#include "gdbsupport/filestuff.h"
+#include "gdbsupport/pathstuff.h"
#include <signal.h>
}
close_most_fds ();
- execl ("/bin/sh", "sh", "-c", name, (char *) 0);
+
+ const char *shellfile = get_shell ();
+ execl (shellfile, shellfile, "-c", name, (char *) 0);
_exit (127);
}