diff options
author | Christopher Faylor <me@cgf.cx> | 2004-02-11 00:29:42 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2004-02-11 00:29:42 +0000 |
commit | 6dbfb93a04322cfb0320210b7a6c0bbd8c36548b (patch) | |
tree | 54dfe25bc35cc1960f190827e97aa519f7e3b223 | |
parent | d832a288e5f4baefa587eb8b997f8073d794adb0 (diff) | |
download | cygnal-6dbfb93a04322cfb0320210b7a6c0bbd8c36548b.tar.gz cygnal-6dbfb93a04322cfb0320210b7a6c0bbd8c36548b.tar.bz2 cygnal-6dbfb93a04322cfb0320210b7a6c0bbd8c36548b.zip |
* strace.cc (main): Guard against previous setting of POSIXLY_CORRECT.
-rw-r--r-- | winsup/utils/ChangeLog | 4 | ||||
-rw-r--r-- | winsup/utils/strace.cc | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index 4609834aa..672e9af83 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,5 +1,9 @@ 2004-02-10 Christopher Faylor <cgf@redhat.com> + * strace.cc (main): Guard against previous setting of POSIXLY_CORRECT. + +2004-02-10 Christopher Faylor <cgf@redhat.com> + * strace.cc: Update copyrights. * cygcheck.cc: Update copyrights. diff --git a/winsup/utils/strace.cc b/winsup/utils/strace.cc index 4511b90ac..df420240d 100644 --- a/winsup/utils/strace.cc +++ b/winsup/utils/strace.cc @@ -903,13 +903,15 @@ main (int argc, char **argv) pid_t pid = 0; int opt; int toggle = 0; + int posixly_correct_set = getenv ("POSIXLY_CORRECT") != NULL; if (!(pgm = strrchr (*argv, '\\')) && !(pgm = strrchr (*argv, '/'))) pgm = *argv; else pgm++; - (void) putenv("POSIXLY_CORRECT=1"); + if (!posixly_correct_set) + (void) putenv("POSIXLY_CORRECT=1"); while ((opt = getopt_long (argc, argv, opts, longopts, NULL)) != EOF) switch (opt) { @@ -994,6 +996,8 @@ character #%d.\n", optarg, (int) (endptr - optarg), endptr); if (!ofile) ofile = stdout; + if (!posixly_correct_set) + putenv ("POSIXLY_CORRECT="); if (toggle) dotoggle (pid); else |