Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2004-02-11 03:29:42 +0300
committerChristopher Faylor <me@cgf.cx>2004-02-11 03:29:42 +0300
commit6dbfb93a04322cfb0320210b7a6c0bbd8c36548b (patch)
tree54dfe25bc35cc1960f190827e97aa519f7e3b223 /winsup/utils
parentd832a288e5f4baefa587eb8b997f8073d794adb0 (diff)
* strace.cc (main): Guard against previous setting of POSIXLY_CORRECT.
Diffstat (limited to 'winsup/utils')
-rw-r--r--winsup/utils/ChangeLog4
-rw-r--r--winsup/utils/strace.cc6
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