* strace.cc (main): Guard against previous setting of POSIXLY_CORRECT.
This commit is contained in:
parent
d832a288e5
commit
6dbfb93a04
|
@ -1,3 +1,7 @@
|
|||
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.
|
||||
|
|
|
@ -903,12 +903,14 @@ 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++;
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue