Re: [PATCH] emacs: show: stop stderr appearing in buffer
[notmuch-archives.git] / 94 / 241f1da9aefab7de119fba5002be254eb1d65a
1 Return-Path: <Vladimir.Marek@oracle.com>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 0538C431FBD\r
6         for <notmuch@notmuchmail.org>; Mon,  6 May 2013 08:16:43 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -2.299\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.299 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_MED=-2.3, UNPARSEABLE_RELAY=0.001]\r
13         autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id yAgNQIxPC2ur for <notmuch@notmuchmail.org>;\r
17         Mon,  6 May 2013 08:16:38 -0700 (PDT)\r
18 Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 83A29431FAE\r
22         for <notmuch@notmuchmail.org>; Mon,  6 May 2013 08:16:34 -0700 (PDT)\r
23 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])\r
24         by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with\r
25         ESMTP id r46FGPht009934\r
26         (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);\r
27         Mon, 6 May 2013 15:16:26 GMT\r
28 Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231])\r
29         by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id\r
30         r46FGNhF027183\r
31         (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL);\r
32         Mon, 6 May 2013 15:16:24 GMT\r
33 Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71])\r
34         by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id\r
35         r46FGN0d003609; Mon, 6 May 2013 15:16:23 GMT\r
36 Received: from vi64-x3-2e-prg06.cz.oracle.com (/10.163.102.127)\r
37         by default (Oracle Beehive Gateway v4.0)\r
38         with ESMTP ; Mon, 06 May 2013 08:16:23 -0700\r
39 From: Vladimir.Marek@oracle.com\r
40 To: notmuch@notmuchmail.org\r
41 Subject: [PATCH 1/4] getpwuid: check for standards compliance (Solaris\r
42  support)\r
43 Date: Mon,  6 May 2013 17:15:59 +0200\r
44 Message-Id: <1367853362-11846-2-git-send-email-Vladimir.Marek@oracle.com>\r
45 X-Mailer: git-send-email 1.7.9.2\r
46 In-Reply-To: <1367853362-11846-1-git-send-email-Vladimir.Marek@oracle.com>\r
47 References: <1367853362-11846-1-git-send-email-Vladimir.Marek@oracle.com>\r
48 X-Source-IP: acsinet21.oracle.com [141.146.126.237]\r
49 Cc: Vladimir Marek <vlmarek@volny.cz>\r
50 X-BeenThere: notmuch@notmuchmail.org\r
51 X-Mailman-Version: 2.1.13\r
52 Precedence: list\r
53 List-Id: "Use and development of the notmuch mail system."\r
54         <notmuch.notmuchmail.org>\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
58 List-Post: <mailto:notmuch@notmuchmail.org>\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
62 X-List-Received-Date: Mon, 06 May 2013 15:16:43 -0000\r
63 \r
64 From: Blake Jones <blakej@foo.net>\r
65 \r
66 Add checks to "configure" to see whether _POSIX_PTHREAD_SEMANTICS needs\r
67 to be defined to get the right number of arguments in the prototypes for\r
68 getpwuid_r().  Solaris' default implementation conforms to POSIX.1c\r
69 Draft 6, rather than the final POSIX.1c spec.  The standards-compliant\r
70 version can be used by defining _POSIX_PTHREAD_SEMANTICS.\r
71 \r
72 This change also adds the file "compat/check_getpwuid.c", which\r
73 configure uses to perform its check, and modifies compat/compat.h to\r
74 define _POSIX_PTHREAD_SEMANTICS if configure detected it was needed.\r
75 \r
76 Signed-off-by: Vladimir Marek <vlmarek@volny.cz>\r
77 ---\r
78  compat/check_getpwuid.c |   11 +++++++++++\r
79  compat/compat.h         |    4 ++++\r
80  configure               |   23 +++++++++++++++++++++--\r
81  3 files changed, 36 insertions(+), 2 deletions(-)\r
82  create mode 100644 compat/check_getpwuid.c\r
83 \r
84 diff --git a/compat/check_getpwuid.c b/compat/check_getpwuid.c\r
85 new file mode 100644\r
86 index 0000000..c435eb8\r
87 --- /dev/null\r
88 +++ b/compat/check_getpwuid.c\r
89 @@ -0,0 +1,11 @@\r
90 +#include <stdio.h>\r
91 +#include <pwd.h>\r
92 +\r
93 +int main()\r
94 +{\r
95 +    struct passwd passwd, *ignored;\r
96 +\r
97 +    (void) getpwuid_r (0, &passwd, NULL, 0, &ignored);\r
98 +\r
99 +    return (0);\r
100 +}\r
101 diff --git a/compat/compat.h b/compat/compat.h\r
102 index b2e2736..c1ee0f9 100644\r
103 --- a/compat/compat.h\r
104 +++ b/compat/compat.h\r
105 @@ -30,6 +30,10 @@\r
106  extern "C" {\r
107  #endif\r
108  \r
109 +#if !STD_GETPWUID\r
110 +#define _POSIX_PTHREAD_SEMANTICS 1\r
111 +#endif\r
112 +\r
113  #if !HAVE_GETLINE\r
114  #include <stdio.h>\r
115  #include <unistd.h>\r
116 diff --git a/configure b/configure\r
117 index 460fcfc..8ef7bac 100755\r
118 --- a/configure\r
119 +++ b/configure\r
120 @@ -517,6 +517,17 @@ else\r
121  fi\r
122  rm -f compat/have_strcasestr\r
123  \r
124 +printf "Checking for standard version of getpwuid_r... "\r
125 +if ${CC} -o compat/check_getpwuid "$srcdir"/compat/check_getpwuid.c > /dev/null 2>&1\r
126 +then\r
127 +    printf "Yes.\n"\r
128 +    std_getpwuid=1\r
129 +else\r
130 +    printf "No (will define _POSIX_PTHREAD_SEMANTICS to get it).\n"\r
131 +    std_getpwuid=0\r
132 +fi\r
133 +rm -f compat/check_getpwuid\r
134 +\r
135  printf "int main(void){return 0;}\n" > minimal.c\r
136  \r
137  printf "Checking for rpath support... "\r
138 @@ -676,6 +687,11 @@ HAVE_GETLINE = ${have_getline}\r
139  # build its own version)\r
140  HAVE_STRCASESTR = ${have_strcasestr}\r
141  \r
142 +# Whether the getpwuid_r function is standards-compliant\r
143 +# (if not, then notmuch will #define _POSIX_PTHREAD_SEMANTICS\r
144 +# to enable the standards-compliant version -- needed for Solaris)\r
145 +STD_GETPWUID = ${std_getpwuid}\r
146 +\r
147  # Supported platforms (so far) are: LINUX, MACOSX, SOLARIS, FREEBSD, OPENBSD\r
148  PLATFORM = ${platform}\r
149  \r
150 @@ -720,10 +736,13 @@ WITH_ZSH = ${WITH_ZSH}\r
151  # Combined flags for compiling and linking against all of the above\r
152  CONFIGURE_CFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS)      \\\r
153                    \$(TALLOC_CFLAGS) -DHAVE_VALGRIND=\$(HAVE_VALGRIND)   \\\r
154 -                  \$(VALGRIND_CFLAGS) -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR)\r
155 +                  \$(VALGRIND_CFLAGS)                                   \\\r
156 +                  -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR)                 \\\r
157 +                  -DSTD_GETPWUID=\$(STD_GETPWUID)\r
158  CONFIGURE_CXXFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS)    \\\r
159                      \$(TALLOC_CFLAGS) -DHAVE_VALGRIND=\$(HAVE_VALGRIND) \\\r
160                      \$(VALGRIND_CFLAGS) \$(XAPIAN_CXXFLAGS)             \\\r
161 -                     -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR)\r
162 +                    -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR)               \\\r
163 +                    -DSTD_GETPWUID=\$(STD_GETPWUID)\r
164  CONFIGURE_LDFLAGS =  \$(GMIME_LDFLAGS) \$(TALLOC_LDFLAGS) \$(XAPIAN_LDFLAGS)\r
165  EOF\r
166 -- \r
167 1.7.9.2\r
168 \r