| author | Vincent Rubiolo | 2012-07-06 05:22:07 (EDT) |
|---|---|---|
| committer | Eugene Tarassov | 2012-07-06 14:21:07 (EDT) |
| commit | 6610ea6c7c8e9c577260e0db60fba6709ff17597 (patch) (side-by-side diff) | |
| tree | 58369c6a275ba6068ac6c19d2f919edb114c4679 | |
| parent | c766f098bfeb9d91c149c4747a5ec01b1c0b0600 (diff) | |
| download | org.eclipse.tcf.agent-6610ea6c7c8e9c577260e0db60fba6709ff17597.zip org.eclipse.tcf.agent-6610ea6c7c8e9c577260e0db60fba6709ff17597.tar.gz org.eclipse.tcf.agent-6610ea6c7c8e9c577260e0db60fba6709ff17597.tar.bz2 | |
Fix crash when running in daemon mode w/o logging
Previous patch for bug#384057 wrongly ordered the && statements in the
test. Since the '&&' operator guarantees left-to-right evaluation, this
could cause crashes when the agent was running in daemon mode without
logging being enabled (i.e w/ log_name being NULL).
| -rw-r--r-- | agent/tcf/main/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/agent/tcf/main/main.c b/agent/tcf/main/main.c index b2c83f8..9f88c97 100644 --- a/agent/tcf/main/main.c +++ b/agent/tcf/main/main.c @@ -274,7 +274,7 @@ int main(int argc, char ** argv) { } } - if (daemon && strcmp (log_name, LOG_NAME_STDERR) != 0 && log_name != NULL) { + if (daemon && log_name != NULL && strcmp (log_name, LOG_NAME_STDERR) != 0) { fprintf(stderr, "%s: error: can only log to stderr when in daemon " "mode.\n", progname); exit (1); |

