From: Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de>
To: git@vger.kernel.org
Subject: [PATCH] cast pid_t to long for printing
Date: Mon, 26 Jun 2006 10:26:06 +0200 [thread overview]
Message-ID: <20060626082606.GC3646@informatik.uni-freiburg.de> (raw)
In-Reply-To: <20060626080912.GA3646@informatik.uni-freiburg.de>
This fixes warnings on Solaris 8.
Signed-off-by: Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de>
---
While fixing daemon.c, I saw that there is a call to syslog using %d for
pid_t, too. I fixed that in the same way without further testing and
manual reading. I assume that's OK.
daemon.c | 9 ++++++---
upload-pack.c | 2 +-
2 files changed, 7 insertions(+), 4 deletions(-)
b339b05462efea5fee9f2b9bf70de03897a5e4ab
diff --git a/daemon.c b/daemon.c
index 1ba4d66..8641b13 100644
--- a/daemon.c
+++ b/daemon.c
@@ -368,7 +368,7 @@ static void remove_child(pid_t pid, unsi
struct child m;
deleted = (deleted + 1) % MAX_CHILDREN;
if (deleted == spawned)
- die("could not find dead child %d\n", pid);
+ die("could not find dead child %ld\n", (long)pid);
m = live_child[deleted];
live_child[deleted] = n;
if (m.pid == pid)
@@ -476,9 +476,12 @@ static void child_handler(int signo)
if (!WIFEXITED(status) || WEXITSTATUS(status) > 0)
dead = " (with error)";
if (log_syslog)
- syslog(LOG_INFO, "[%d] Disconnected%s", pid, dead);
+ syslog(LOG_INFO, "[%ld] Disconnected%s",
+ (long)pid, dead);
else
- fprintf(stderr, "[%d] Disconnected%s\n", pid, dead);
+ fprintf(stderr,
+ "[%ld] Disconnected%s\n",
+ (long)pid, dead);
}
continue;
}
diff --git a/upload-pack.c b/upload-pack.c
index 7b86f69..fdfef39 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -274,7 +274,7 @@ static void create_pack_file(void)
goto fail;
}
error("git-upload-pack: we weren't "
- "waiting for %d", pid);
+ "waiting for %ld", (long)pid);
continue;
}
if (!WIFEXITED(status) || WEXITSTATUS(status) > 0) {
--
1.1.6.g7d80e
--
Uwe Zeisberger
exit vi, lesson V:
o : q ! CTRL-V <CR> <Esc> " d d d @ d
next prev parent reply other threads:[~2006-06-26 8:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-26 8:09 Solaris 8 Uwe Zeisberger
2006-06-26 8:23 ` [PATCH] include signal.h for prototype of signal() Uwe Zeisberger
2006-06-26 8:51 ` Uwe Zeisberger
2006-06-26 8:26 ` Uwe Zeisberger [this message]
2006-06-26 9:26 ` [PATCH] cast pid_t to long for printing Junio C Hamano
2006-06-26 12:13 ` Uwe Zeisberger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060626082606.GC3646@informatik.uni-freiburg.de \
--to=zeisberg@informatik.uni-freiburg.de \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).