Small things.
This commit is contained in:
parent
ef65a64443
commit
96f5d98fc2
2 changed files with 10 additions and 3 deletions
|
@ -40,7 +40,7 @@ extern void bin2hex(char *src, char *dst, int length);
|
||||||
|
|
||||||
#ifdef HAVE_MINGW
|
#ifdef HAVE_MINGW
|
||||||
extern char *winerror(int);
|
extern char *winerror(int);
|
||||||
#define strerror(x) (x>0?strerror(x):winerror(GetLastError()))
|
#define strerror(x) ((x)>0?strerror(x):winerror(GetLastError()))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __TINC_UTILS_H__ */
|
#endif /* __TINC_UTILS_H__ */
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
$Id: process.c,v 1.1.2.67 2003/08/08 19:43:47 guus Exp $
|
$Id: process.c,v 1.1.2.68 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));
|
strncat(command, program_name, sizeof(command));
|
||||||
for(argp = g_argv + 1; *argp; argp++) {
|
for(argp = g_argv + 1; *argp; argp++) {
|
||||||
space = strchr(*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)
|
if(space)
|
||||||
strncat(command, "\"", sizeof(command));
|
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);
|
ifdebug(STATUS) logger(LOG_INFO, _("Executing script %s"), name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_PUTENV
|
||||||
/* Set environment */
|
/* Set environment */
|
||||||
|
|
||||||
while(*envp)
|
while(*envp)
|
||||||
putenv(*envp++);
|
putenv(*envp++);
|
||||||
|
#endif
|
||||||
|
|
||||||
status = system(scriptname);
|
status = system(scriptname);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue