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

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'trace.c')
-rw-r--r--trace.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/trace.c b/trace.c
index 083eb984e1..7508aea028 100644
--- a/trace.c
+++ b/trace.c
@@ -61,10 +61,9 @@ static int get_trace_fd(struct trace_key *key)
else if (is_absolute_path(trace)) {
int fd = open(trace, O_WRONLY | O_APPEND | O_CREAT, 0666);
if (fd == -1) {
- warning("could not open '%s' for tracing: %s\n"
- " Defaulting to tracing on stderr...",
+ warning("could not open '%s' for tracing: %s",
trace, strerror(errno));
- key->fd = STDERR_FILENO;
+ trace_disable(key);
} else {
key->fd = fd;
key->need_close = 1;
@@ -72,10 +71,9 @@ static int get_trace_fd(struct trace_key *key)
} else {
warning("unknown trace value for '%s': %s\n"
" If you want to trace into a file, then please set %s\n"
- " to an absolute pathname (starting with /)\n"
- " Defaulting to tracing on stderr...",
+ " to an absolute pathname (starting with /)",
key->key, trace, key->key);
- key->fd = STDERR_FILENO;
+ trace_disable(key);
}
key->initialized = 1;