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.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/trace.c b/trace.c
index e583dc63bb..3c3bd8fc98 100644
--- a/trace.c
+++ b/trace.c
@@ -122,9 +122,7 @@ static int prepare_trace_line(const char *file, int line,
static void print_trace_line(struct trace_key *key, struct strbuf *buf)
{
- /* append newline if missing */
- if (buf->len && buf->buf[buf->len - 1] != '\n')
- strbuf_addch(buf, '\n');
+ strbuf_complete_line(buf);
write_or_whine_pipe(get_trace_fd(key), buf->buf, buf->len, err_msg);
strbuf_release(buf);
@@ -216,7 +214,7 @@ void trace_argv_printf(const char **argv, const char *format, ...)
va_end(ap);
}
-void trace_strbuf(const char *key, const struct strbuf *data)
+void trace_strbuf(struct trace_key *key, const struct strbuf *data)
{
trace_strbuf_fl(NULL, 0, key, data);
}
@@ -298,13 +296,12 @@ void trace_repo_setup(const char *prefix)
{
static struct trace_key key = TRACE_KEY_INIT(SETUP);
const char *git_work_tree;
- char cwd[PATH_MAX];
+ char *cwd;
if (!trace_want(&key))
return;
- if (!getcwd(cwd, PATH_MAX))
- die("Unable to get current working directory");
+ cwd = xgetcwd();
if (!(git_work_tree = get_git_work_tree()))
git_work_tree = "(null)";
@@ -313,9 +310,12 @@ void trace_repo_setup(const char *prefix)
prefix = "(null)";
trace_printf_key(&key, "setup: git_dir: %s\n", quote_crnl(get_git_dir()));
+ trace_printf_key(&key, "setup: git_common_dir: %s\n", quote_crnl(get_git_common_dir()));
trace_printf_key(&key, "setup: worktree: %s\n", quote_crnl(git_work_tree));
trace_printf_key(&key, "setup: cwd: %s\n", quote_crnl(cwd));
trace_printf_key(&key, "setup: prefix: %s\n", quote_crnl(prefix));
+
+ free(cwd);
}
int trace_want(struct trace_key *key)
@@ -323,7 +323,7 @@ int trace_want(struct trace_key *key)
return !!get_trace_fd(key);
}
-#ifdef HAVE_CLOCK_GETTIME
+#if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_CLOCK_MONOTONIC)
static inline uint64_t highres_nanos(void)
{
@@ -384,7 +384,7 @@ static inline uint64_t gettimeofday_nanos(void)
* Returns nanoseconds since the epoch (01/01/1970), for performance tracing
* (i.e. favoring high precision over wall clock time accuracy).
*/
-inline uint64_t getnanotime(void)
+uint64_t getnanotime(void)
{
static uint64_t offset;
if (offset > 1) {