From 521fa3d9edfd54446dfa04f26e7e93bed33414e2 Mon Sep 17 00:00:00 2001 From: Blake Jones Date: Tue, 6 Nov 2012 11:02:02 +1600 Subject: [PATCH] [PATCH v2 09/10] debugger.c: correct return type from getppid() (Solaris support) --- db/3173f17f0be9504c50c34bd00443c44045afb9 | 75 +++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 db/3173f17f0be9504c50c34bd00443c44045afb9 diff --git a/db/3173f17f0be9504c50c34bd00443c44045afb9 b/db/3173f17f0be9504c50c34bd00443c44045afb9 new file mode 100644 index 000000000..a6b488bf9 --- /dev/null +++ b/db/3173f17f0be9504c50c34bd00443c44045afb9 @@ -0,0 +1,75 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 752E4431FCB + for ; Mon, 5 Nov 2012 11:02:30 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id dduqQnXnRGWF for ; + Mon, 5 Nov 2012 11:02:29 -0800 (PST) +Received: from foo.net (70-36-235-136.dsl.static.sonic.net [70.36.235.136]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 16517431FC3 + for ; Mon, 5 Nov 2012 11:02:26 -0800 (PST) +Received: from foo.net (localhost [127.0.0.1]) + by foo.net (8.14.5+Sun/8.14.5) with ESMTP id qA5J2OMM019142; + Mon, 5 Nov 2012 11:02:24 -0800 (PST) +Received: (from blakej@localhost) + by foo.net (8.14.5+Sun/8.14.5/Submit) id qA5J2O4q019141; + Mon, 5 Nov 2012 11:02:24 -0800 (PST) +From: Blake Jones +To: notmuch@notmuchmail.org +Subject: [PATCH v2 09/10] debugger.c: correct return type from getppid() + (Solaris support) +Date: Mon, 5 Nov 2012 11:02:02 -0800 +Message-Id: <1352142123-18286-10-git-send-email-blakej@foo.net> +X-Mailer: git-send-email 1.7.3.2 +In-Reply-To: <1352142123-18286-1-git-send-email-blakej@foo.net> +References: <1352142123-18286-1-git-send-email-blakej@foo.net> +X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 + (foo.net [127.0.0.1]); Mon, 05 Nov 2012 11:02:24 -0800 (PST) +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Mon, 05 Nov 2012 19:02:30 -0000 + +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 files changed, 1 insertions(+), 1 deletions(-) + +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.3.2 + -- 2.26.2