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

2012-11-04 Thread 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

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


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

2012-11-03 Thread 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