version --build-options: report commit, too, if possible
[gitweb.git] / trace.c
diff --git a/trace.c b/trace.c
index 083eb984e15ea4d65c1f7c3250f7e69775c66d74..cb1293ed33e16f605f8ac99336f040275c7bda7a 100644 (file)
--- a/trace.c
+++ b/trace.c
@@ -18,8 +18,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "cache.h"
@@ -61,10 +60,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 +70,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;