git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/4] Fix git-daemon's pid_t logging

From
Petr Baudis <pasky@suse.cz>
Date
Sep 24, 2005, 14:12 UTC
Message-ID
<20050924141256.8423.53339.stgit@machine.or.cz>
In-Reply-To
<20050924141254.8423.80265.stgit@machine.or.cz>

git-daemon's logging code did not properly printf() pid_t - we need to explicitly typecast it, since it might not be int. Pointed out by Morten Welinder.

Signed-off-by: Petr Baudis <pasky@suse.cz>
---
 daemon.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/daemon.c b/daemon.c
--- a/daemon.c
+++ b/daemon.c
@@ -22,7 +22,7 @@ static void logreport(const char *err, v
 	int maxlen, msglen;
 
 	/* sizeof(buf) should be big enough for "[pid] \n" */
-	buflen = snprintf(buf, sizeof(buf), "[%d] ", getpid());
+	buflen = snprintf(buf, sizeof(buf), "[%ld] ", (long) getpid());
 
 	maxlen = sizeof(buf) - buflen - 1; /* -1 for our own LF */
 	msglen = vsnprintf(buf + buflen, maxlen, err, params);
Previous: Petr BaudisNext: Petr Baudis
Message 2 of 5 in “Minor git-daemon enhancements”
  1. 0/4 Minor git-daemon enhancementsPetr Baudis, Sep 24, 2005
  2. 1/4 Fix git-daemon's pid_t loggingPetr Baudis, Sep 24, 2005
  3. 2/4 Update git-daemon documentation wrt. the --verbose parameterPetr Baudis, Sep 24, 2005
  4. 3/4 git-daemon --syslog to log through syslogPetr Baudis, Sep 24, 2005
  5. 4/4 Rename daemon.c's lognotice() to loginfo()Petr Baudis, Sep 24, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.