aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2001-05-11 15:16:28 +0000
committerMatt Kraai <kraai@debian.org>2001-05-11 15:16:28 +0000
commiteb5f433736c80ee6d3909b2803827b5d7af58bcf (patch)
treef4de688a2b8f96cbc625364bd7c94560b5db097e
parentc96381be40f1fd56f9eca11f43be7a10865c1881 (diff)
downloadbusybox-w32-eb5f433736c80ee6d3909b2803827b5d7af58bcf.tar.gz
busybox-w32-eb5f433736c80ee6d3909b2803827b5d7af58bcf.tar.bz2
busybox-w32-eb5f433736c80ee6d3909b2803827b5d7af58bcf.zip
Check that putenv succeeded, suggested by Jonas Holmberg.
-rw-r--r--coreutils/env.c3
-rw-r--r--env.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/coreutils/env.c b/coreutils/env.c
index aca7c3ae2..626fc1952 100644
--- a/coreutils/env.c
+++ b/coreutils/env.c
@@ -59,7 +59,8 @@ extern int env_main(int argc, char** argv)
59 cleanenv[0] = NULL; 59 cleanenv[0] = NULL;
60 } 60 }
61 for (argv += optind; *argv && (p = strchr(*argv, '=')); ++argv) 61 for (argv += optind; *argv && (p = strchr(*argv, '=')); ++argv)
62 putenv(*argv); 62 if (putenv(*argv) < 0)
63 perror_msg_and_die("%s", *argv);
63 if (*argv) { 64 if (*argv) {
64 execvp(*argv, argv); 65 execvp(*argv, argv);
65 perror_msg_and_die("%s", *argv); 66 perror_msg_and_die("%s", *argv);
diff --git a/env.c b/env.c
index aca7c3ae2..626fc1952 100644
--- a/env.c
+++ b/env.c
@@ -59,7 +59,8 @@ extern int env_main(int argc, char** argv)
59 cleanenv[0] = NULL; 59 cleanenv[0] = NULL;
60 } 60 }
61 for (argv += optind; *argv && (p = strchr(*argv, '=')); ++argv) 61 for (argv += optind; *argv && (p = strchr(*argv, '=')); ++argv)
62 putenv(*argv); 62 if (putenv(*argv) < 0)
63 perror_msg_and_die("%s", *argv);
63 if (*argv) { 64 if (*argv) {
64 execvp(*argv, argv); 65 execvp(*argv, argv);
65 perror_msg_and_die("%s", *argv); 66 perror_msg_and_die("%s", *argv);