[PATCH 09/10] debugger.c: correct return type from getppid() (Solaris support)

Subject: [PATCH 09/10] debugger.c: correct return type from getppid() (Solaris support)

Date: Sat, 3 Nov 2012 20:16:01 -0700

To: notmuch@notmuchmail.org

Cc: Blake Jones

From: Blake Jones


Cast the return value of getppid() to "int" from "pid_t" in debugger.c,
since it is being passed to sprintf("%d"), which wants an "int"
argument.  On Solaris, "pid_t" is a "long" for 32-bit programs.
---
 debugger.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debugger.c b/debugger.c
index e8b9378..8ff13d6 100644
--- a/debugger.c
+++ b/debugger.c
@@ -36,7 +36,7 @@ debugger_is_active (void)
     if (RUNNING_ON_VALGRIND)
 	return TRUE;
 
-    sprintf (buf, "/proc/%d/exe", getppid ());
+    sprintf (buf, "/proc/%d/exe", (int) getppid ());
     if (readlink (buf, buf, sizeof (buf)) != -1 &&
 	strncmp (basename (buf), "gdb", 3) == 0)
     {
-- 
1.7.9.2


Thread: