#include <getopt.h>
#include <limits.h>
#include <fcntl.h>
+#include <paths.h>
#include <xcb/xcb.h>
#include <xcb/xcb_aux.h>
/* Child process */
setsid();
if (fork() == 0) {
- /* Stores the path of the shell */
- static const char *shell = NULL;
-
- if (shell == NULL)
- if ((shell = getenv("SHELL")) == NULL)
- shell = "/bin/sh";
-
/* This is the child */
- execl(shell, shell, "-c", command, (void*)NULL);
+ execl(_PATH_BSHELL, _PATH_BSHELL, "-c", command, (void*)NULL);
/* not reached */
}
exit(0);
#include <yajl/yajl_parse.h>
#include <yajl/yajl_version.h>
#include <yajl/yajl_gen.h>
+#include <paths.h>
#include "common.h"
dup2(pipe_in[1], STDOUT_FILENO);
dup2(pipe_out[0], STDIN_FILENO);
- static const char *shell = NULL;
-
- if ((shell = getenv("SHELL")) == NULL)
- shell = "/bin/sh";
-
- execl(shell, shell, "-c", command, (char*) NULL);
+ execl(_PATH_BSHELL, _PATH_BSHELL, "-c", command, (char*) NULL);
return;
default:
/* Parent-process. Reroute streams */
#include <sys/types.h>
#include <sys/wait.h>
+#include <paths.h>
#define SN_API_NOT_YET_FROZEN 1
#include <libsn/sn-launcher.h>
if (!no_startup_id)
sn_launcher_context_setup_child_process(context);
- /* Stores the path of the shell */
- static const char *shell = NULL;
-
- if (shell == NULL)
- if ((shell = getenv("SHELL")) == NULL)
- shell = "/bin/sh";
-
- /* This is the child */
- execl(shell, shell, "-c", command, (void*)NULL);
+ execl(_PATH_BSHELL, _PATH_BSHELL, "-c", command, (void*)NULL);
/* not reached */
}
_exit(0);