aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Karl DeBisschop <kdebisschop@users.sourceforge.net> 2003-08-01 06:01:50 +0000
committerGravatar Karl DeBisschop <kdebisschop@users.sourceforge.net> 2003-08-01 06:01:50 +0000
commit0b9ca89dbb0329b07a844f5b4de46e50171705d1 (patch)
tree3c9482e3254071b7094f6de2a0939b8b05e75719
parent30c81e1c780ea80d316ee5f705b124abe4ab12bd (diff)
downloadmonitoring-plugins-0b9ca89dbb0329b07a844f5b4de46e50171705d1.tar.gz
set LC_ALL to C in execve environemnt
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@625 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r--plugins/popen.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/popen.c b/plugins/popen.c
index d4151e61..e41ae9ae 100644
--- a/plugins/popen.c
+++ b/plugins/popen.c
@@ -67,7 +67,7 @@ static int maxfd; /* from our open_max(), {Prog openmax} */
FILE *
spopen (const char *cmdstring)
{
- char *environ[] = { NULL };
+ char *env[] = { "LC_ALL=C", (char*)0 };
char *cmd = NULL;
char **argv = NULL;
char *str;
@@ -182,7 +182,7 @@ spopen (const char *cmdstring)
if (childpid[i] > 0)
close (i);
- execve (argv[0], argv, environ);
+ execve (argv[0], argv, env);
_exit (0);
}
@@ -199,7 +199,7 @@ spopen (const char *cmdstring)
int
spclose (FILE * fp)
{
- int fd, stat;
+ int fd, status;
pid_t pid;
if (childpid == NULL)
@@ -213,12 +213,12 @@ spclose (FILE * fp)
if (fclose (fp) == EOF)
return (1);
- while (waitpid (pid, &stat, 0) < 0)
+ while (waitpid (pid, &status, 0) < 0)
if (errno != EINTR)
return (1); /* error other than EINTR from waitpid() */
- if (WIFEXITED (stat))
- return (WEXITSTATUS (stat)); /* return child's termination status */
+ if (WIFEXITED (status))
+ return (WEXITSTATUS (status)); /* return child's termination status */
return (1);
}