projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Small things.
[tinc]
/
src
/
process.c
diff --git
a/src/process.c
b/src/process.c
index
5566510
..
d81fdd6
100644
(file)
--- a/
src/process.c
+++ b/
src/process.c
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: process.c,v 1.1.2.6
6 2003/08/08 17:17:13
guus Exp $
+ $Id: process.c,v 1.1.2.6
8 2003/08/08 19:56:11
guus Exp $
*/
#include "system.h"
*/
#include "system.h"
@@
-99,11
+99,14
@@
bool install_service(void) {
strncat(command, program_name, sizeof(command));
for(argp = g_argv + 1; *argp; argp++) {
strncat(command, program_name, sizeof(command));
for(argp = g_argv + 1; *argp; argp++) {
- space = strchr(*argp,
" "
);
+ space = strchr(*argp,
' '
);
strncat(command, " ", sizeof(command));
strncat(command, " ", sizeof(command));
+
if(space)
strncat(command, "\"", sizeof(command));
if(space)
strncat(command, "\"", sizeof(command));
+
strncat(command, *argp, sizeof(command));
strncat(command, *argp, sizeof(command));
+
if(space)
strncat(command, "\"", sizeof(command));
}
if(space)
strncat(command, "\"", sizeof(command));
}
@@
-363,19
+366,23
@@
bool execute_script(const char *name, char **envp)
cp();
cp();
- asprintf(&scriptname, "
%s/%s
", confbase, name);
+ asprintf(&scriptname, "
\"%s/%s\"
", confbase, name);
+#ifndef HAVE_MINGW
/* First check if there is a script */
if(stat(scriptname, &s))
return true;
/* First check if there is a script */
if(stat(scriptname, &s))
return true;
+ ifdebug(STATUS) logger(LOG_INFO, _("Executing script %s"), name);
+#endif
+
+#ifdef HAVE_PUTENV
/* Set environment */
while(*envp)
putenv(*envp++);
/* Set environment */
while(*envp)
putenv(*envp++);
-
- ifdebug(STATUS) logger(LOG_INFO, _("Executing script %s"), name);
+#endif
status = system(scriptname);
status = system(scriptname);
@@
-383,6
+390,7
@@
bool execute_script(const char *name, char **envp)
/* Unset environment? */
/* Unset environment? */
+#ifdef WEXITSTATUS
if(status != -1) {
if(WIFEXITED(status)) { /* Child exited by itself */
if(WEXITSTATUS(status)) {
if(status != -1) {
if(WIFEXITED(status)) { /* Child exited by itself */
if(WEXITSTATUS(status)) {
@@
-404,6
+412,7
@@
bool execute_script(const char *name, char **envp)
strerror(errno));
return false;
}
strerror(errno));
return false;
}
+#endif
#endif
return true;
}
#endif
return true;
}