File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 72
72
debug(LOG_DEBUG, "wd_gethostbyname() unlocked"); \
73
73
} while (0)
74
74
75
+ #include "../config.h"
76
+ #ifdef __ANDROID__
77
+ #define WD_SHELL_PATH "/system/bin/sh"
78
+ #else
79
+ #define WD_SHELL_PATH "/bin/sh"
80
+ #endif
81
+
75
82
/** @brief FD for icmp raw socket */
76
83
static int icmp_fd ;
77
84
@@ -91,7 +98,7 @@ execute(const char *cmd_line, int quiet)
91
98
int pid , status , rc ;
92
99
93
100
const char * new_argv [4 ];
94
- new_argv [0 ] = "/bin/sh" ;
101
+ new_argv [0 ] = WD_SHELL_PATH ;
95
102
new_argv [1 ] = "-c" ;
96
103
new_argv [2 ] = cmd_line ;
97
104
new_argv [3 ] = NULL ;
@@ -101,7 +108,7 @@ execute(const char *cmd_line, int quiet)
101
108
/* We don't want to see any errors if quiet flag is on */
102
109
if (quiet )
103
110
close (2 );
104
- if (execvp ("/bin/sh" , (char * const * )new_argv ) == -1 ) { /* execute the command */
111
+ if (execvp (WD_SHELL_PATH , (char * const * )new_argv ) == -1 ) { /* execute the command */
105
112
debug (LOG_ERR , "execvp(): %s" , strerror (errno ));
106
113
} else {
107
114
debug (LOG_ERR , "execvp() failed" );
You can’t perform that action at this time.
0 commit comments