RE: Reply all - issue
[notmuch-archives.git] / 8b / 45bf2a7292abfd88530ebf5f4c88a9b010d2ad
1 Return-Path: <blakej@foo.net>\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 3FF86431FB6\r
6         for <notmuch@notmuchmail.org>; Sat,  3 Nov 2012 20:24:20 -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: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id Cvuw919-Pj8G for <notmuch@notmuchmail.org>;\r
16         Sat,  3 Nov 2012 20:24:19 -0700 (PDT)\r
17 Received: from foo.net (70-36-235-136.dsl.static.sonic.net [70.36.235.136])\r
18         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 8B876431FAE\r
21         for <notmuch@notmuchmail.org>; Sat,  3 Nov 2012 20:24:19 -0700 (PDT)\r
22 Received: from foo.net (localhost [127.0.0.1])\r
23         by foo.net (8.14.5+Sun/8.14.5) with ESMTP id qA43GCFo025652;\r
24         Sat, 3 Nov 2012 20:16:12 -0700 (PDT)\r
25 Received: (from blakej@localhost)\r
26         by foo.net (8.14.5+Sun/8.14.5/Submit) id qA43GCGv025651;\r
27         Sat, 3 Nov 2012 20:16:12 -0700 (PDT)\r
28 From: Blake Jones <blakej@foo.net>\r
29 To: notmuch@notmuchmail.org\r
30 Subject: [PATCH 01/10] getpwuid: check for standards compliance (Solaris\r
31         support)\r
32 Date: Sat,  3 Nov 2012 20:15:53 -0700\r
33 Message-Id: <1351998962-25135-2-git-send-email-blakej@foo.net>\r
34 X-Mailer: git-send-email 1.7.3.2\r
35 In-Reply-To: <1351998962-25135-1-git-send-email-blakej@foo.net>\r
36 References: <1351998962-25135-1-git-send-email-blakej@foo.net>\r
37 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2\r
38         (foo.net [127.0.0.1]); Sat, 03 Nov 2012 20:16:12 -0700 (PDT)\r
39 X-Mailman-Approved-At: Sun, 04 Nov 2012 01:30:19 -0800\r
40 Cc: Blake Jones <blakej@foo.net>\r
41 X-BeenThere: notmuch@notmuchmail.org\r
42 X-Mailman-Version: 2.1.13\r
43 Precedence: list\r
44 List-Id: "Use and development of the notmuch mail system."\r
45         <notmuch.notmuchmail.org>\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
49 List-Post: <mailto:notmuch@notmuchmail.org>\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
53 X-List-Received-Date: Sun, 04 Nov 2012 03:24:20 -0000\r
54 \r
55 Add checks to "configure" to see whether _POSIX_PTHREAD_SEMANTICS needs\r
56 to be defined to get the right number of arguments in the prototypes for\r
57 getpwuid_r().  Solaris' default implementation conforms to POSIX.1c\r
58 Draft 6, rather than the final POSIX.1c spec.  The standards-compliant\r
59 version can be used by defining _POSIX_PTHREAD_SEMANTICS.\r
60 \r
61 This change also adds the file "compat/check_getpwuid.c", which\r
62 configure uses to perform its check, and modifies compat/compat.h to\r
63 define _POSIX_PTHREAD_SEMANTICS if configure detected it was needed.\r
64 ---\r
65  compat/check_getpwuid.c |   10 ++++++++++\r
66  compat/compat.h         |    4 ++++\r
67  configure               |   23 +++++++++++++++++++++--\r
68  3 files changed, 35 insertions(+), 2 deletions(-)\r
69  create mode 100644 compat/check_getpwuid.c\r
70 \r
71 diff --git a/compat/check_getpwuid.c b/compat/check_getpwuid.c\r
72 new file mode 100644\r
73 index 0000000..5da2590\r
74 --- /dev/null\r
75 +++ b/compat/check_getpwuid.c\r
76 @@ -0,0 +1,10 @@\r
77 +#include <pwd.h>\r
78 +\r
79 +int main()\r
80 +{\r
81 +    struct passwd passwd, *ignored;\r
82 +\r
83 +    (void) getpwuid_r (0, &passwd, NULL, 0, &ignored);\r
84 +\r
85 +    return (0);\r
86 +}\r
87 diff --git a/compat/compat.h b/compat/compat.h\r
88 index b2e2736..8374d2f 100644\r
89 --- a/compat/compat.h\r
90 +++ b/compat/compat.h\r
91 @@ -54,6 +54,10 @@ char* strcasestr(const char *haystack, const char *needle);\r
92  #define IGNORE_RESULT(x) x\r
93  #endif /* __GNUC__ */\r
94  \r
95 +#if !STD_GETPWUID\r
96 +#define _POSIX_PTHREAD_SEMANTICS\r
97 +#endif\r
98 +\r
99  #ifdef __cplusplus\r
100  }\r
101  #endif\r
102 diff --git a/configure b/configure\r
103 index ea8a1ad..3c18a45 100755\r
104 --- a/configure\r
105 +++ b/configure\r
106 @@ -512,6 +512,17 @@ else\r
107  fi\r
108  rm -f compat/have_strcasestr\r
109  \r
110 +printf "Checking for standard version of getpwuid_r... "\r
111 +if ${CC} -o compat/check_getpwuid "$srcdir"/compat/check_getpwuid.c > /dev/null 2>&1\r
112 +then\r
113 +    printf "Yes.\n"\r
114 +    std_getpwuid=1\r
115 +else\r
116 +    printf "No (will define _POSIX_PTHREAD_SEMANTICS to get it).\n"\r
117 +    std_getpwuid=0\r
118 +fi\r
119 +rm -f compat/check_getpwuid\r
120 +\r
121  printf "int main(void){return 0;}\n" > minimal.c\r
122  \r
123  printf "Checking for rpath support... "\r
124 @@ -671,6 +682,11 @@ HAVE_GETLINE = ${have_getline}\r
125  # build its own version)\r
126  HAVE_STRCASESTR = ${have_strcasestr}\r
127  \r
128 +# Whether the getpwuid_r function is standards-compliant\r
129 +# (if not, then notmuch will compile with -D_POSIX_PTHREAD_SEMANTICS\r
130 +# to enable the standards-compliant version -- needed for Solaris)\r
131 +STD_GETPWUID = ${std_getpwuid}\r
132 +\r
133  # Supported platforms (so far) are: LINUX, MACOSX, SOLARIS, FREEBSD, OPENBSD\r
134  PLATFORM = ${platform}\r
135  \r
136 @@ -715,10 +731,13 @@ WITH_ZSH = ${WITH_ZSH}\r
137  # Combined flags for compiling and linking against all of the above\r
138  CONFIGURE_CFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS)      \\\r
139                    \$(TALLOC_CFLAGS) -DHAVE_VALGRIND=\$(HAVE_VALGRIND)   \\\r
140 -                  \$(VALGRIND_CFLAGS) -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR)\r
141 +                  \$(VALGRIND_CFLAGS)                                   \\\r
142 +                  -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR)                 \\\r
143 +                  -DSTD_GETPWUID=\$(STD_GETPWUID)\r
144  CONFIGURE_CXXFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS)    \\\r
145                      \$(TALLOC_CFLAGS) -DHAVE_VALGRIND=\$(HAVE_VALGRIND) \\\r
146                      \$(VALGRIND_CFLAGS) \$(XAPIAN_CXXFLAGS)             \\\r
147 -                     -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR)\r
148 +                    -DHAVE_STRCASESTR=\$(HAVE_STRCASESTR)               \\\r
149 +                    -DSTD_GETPWUID=\$(STD_GETPWUID)\r
150  CONFIGURE_LDFLAGS =  \$(GMIME_LDFLAGS) \$(TALLOC_LDFLAGS) \$(XAPIAN_LDFLAGS)\r
151  EOF\r
152 -- \r
153 1.7.9.2\r
154 \r