projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
ef65a64
)
Small things.
author
Guus Sliepen
<guus@tinc-vpn.org>
Fri, 8 Aug 2003 19:56:11 +0000
(19:56 +0000)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Fri, 8 Aug 2003 19:56:11 +0000
(19:56 +0000)
lib/utils.h
patch
|
blob
|
history
src/process.c
patch
|
blob
|
history
diff --git
a/lib/utils.h
b/lib/utils.h
index
af65427
..
4b0ab3d
100644
(file)
--- a/
lib/utils.h
+++ b/
lib/utils.h
@@
-40,7
+40,7
@@
extern void bin2hex(char *src, char *dst, int length);
#ifdef HAVE_MINGW
extern char *winerror(int);
#ifdef HAVE_MINGW
extern char *winerror(int);
-#define strerror(x) (
x
>0?strerror(x):winerror(GetLastError()))
+#define strerror(x) (
(x)
>0?strerror(x):winerror(GetLastError()))
#endif
#endif /* __TINC_UTILS_H__ */
#endif
#endif /* __TINC_UTILS_H__ */
diff --git
a/src/process.c
b/src/process.c
index
43ce5bd
..
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
7 2003/08/08 19:43:47
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"
@@
-100,8
+100,13
@@
bool install_service(void) {
strncat(command, program_name, sizeof(command));
for(argp = g_argv + 1; *argp; argp++) {
space = strchr(*argp, ' ');
strncat(command, program_name, sizeof(command));
for(argp = g_argv + 1; *argp; argp++) {
space = strchr(*argp, ' ');
- strncat(command, space?" \"":" ", sizeof(command));
+ 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));
}
@@
-372,10
+377,12
@@
bool execute_script(const char *name, char **envp)
ifdebug(STATUS) logger(LOG_INFO, _("Executing script %s"), name);
#endif
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++);
+#endif
status = system(scriptname);
status = system(scriptname);