]> andersk Git - test.git/commitdiff
Minor clean ups. Came up with a feature test for the function signature used
authorMarkus Gutschke <markus@shellinabox.com>
Wed, 29 Sep 2010 18:15:05 +0000 (18:15 +0000)
committerMarkus Gutschke <markus@shellinabox.com>
Wed, 29 Sep 2010 18:15:05 +0000 (18:15 +0000)
by getgrouplist(). Added a few more UNUSED() macros.

config.h
config.h.in
configure
configure.ac
demo/vt100.js
shellinabox/launcher.c
shellinabox/shell_in_a_box.js
shellinabox/shellinaboxd.c
shellinabox/vt100.js

index 8441265103be1718211f329a292f039d22744cb0..d7e2ebb6b24ff5008e296f0b6fa69924400969a1 100644 (file)
--- a/config.h
+++ b/config.h
@@ -22,6 +22,9 @@
 /* Define to 1 if you have the `getgrnam_r' function. */
 #define HAVE_GETGRNAM_R 1
 
+/* Define to 1 if getgrouplist() takes ints as arguments */
+/* #undef HAVE_GETGROUPLIST_TAKES_INTS */
+
 /* Define to 1 if you have the `gethostbyname_r' function. */
 #define HAVE_GETHOSTBYNAME_R 1
 
 #define STDC_HEADERS 1
 
 /* Most recent revision number in the version control system */
-#define VCS_REVISION "232"
+#define VCS_REVISION "233"
 
 /* Version number of package */
 #define VERSION "2.10"
index 94f67379438c0fbbbff209562ddbd7d7333e250a..6a3ba1dc94e1e3be69b8235dc54309c3535ad9ea 100644 (file)
@@ -21,6 +21,9 @@
 /* Define to 1 if you have the `getgrnam_r' function. */
 #undef HAVE_GETGRNAM_R
 
+/* Define to 1 if getgrouplist() takes ints as arguments */
+#undef HAVE_GETGROUPLIST_TAKES_INTS
+
 /* Define to 1 if you have the `gethostbyname_r' function. */
 #undef HAVE_GETHOSTBYNAME_R
 
index 827be844d20a9c6eb3b849d37fbb5ac9c72d2eb9..365667529cba515b905e347cdea1d036b4decfe8 100755 (executable)
--- a/configure
+++ b/configure
@@ -2328,7 +2328,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-VCS_REVISION=232
+VCS_REVISION=233
 
 
 cat >>confdefs.h <<_ACEOF
@@ -10805,6 +10805,27 @@ if ac_fn_c_try_link "$LINENO"; then :
 
 $as_echo "#define HAVE_ATTRIBUTE_UNUSED 1" >>confdefs.h
 
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#define _BSD_SOURCE
+             #include <grp.h>
+             #include <unistd.h>
+int
+main ()
+{
+int (*f)(const char *, int, int *, int *) = getgrouplist;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+$as_echo "#define HAVE_GETGROUPLIST_TAKES_INTS 1" >>confdefs.h
+
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
index fb80da4d59ce685f5337f090c4708f7992a7148a..ef30c2615096774c96ac432b8911ce23be6a877c 100644 (file)
@@ -2,7 +2,7 @@ AC_PREREQ(2.57)
 
 dnl This is the one location where the authoritative version number is stored
 AC_INIT(shellinabox, 2.10, markus@shellinabox.com)
-VCS_REVISION=232
+VCS_REVISION=233
 AC_SUBST(VCS_REVISION)
 AC_DEFINE_UNQUOTED(VCS_REVISION, "${VCS_REVISION}",
                    [Most recent revision number in the version control system])
@@ -84,6 +84,14 @@ AC_TRY_LINK([void x(int i __attribute__((unused))) __attribute__((unused));],
             [AC_DEFINE(HAVE_ATTRIBUTE_UNUSED, 1,
                   Define to 1 if you have support for the "unused" attribute)])
 
+dnl Check the function signature of getgrouplist()
+AC_TRY_LINK([#define _BSD_SOURCE
+             #include <grp.h>
+             #include <unistd.h>],
+            [int (*f)(const char *, int, int *, int *) = getgrouplist;],
+            [AC_DEFINE(HAVE_GETGROUPLIST_TAKES_INTS, 1,
+                       Define to 1 if getgrouplist() takes ints as arguments)])
+
 dnl On some systems, calling /bin/login does not work. Disable the LOGIN
 dnl feature, if the user tells us that it does not do the right thing.
 AC_ARG_ENABLE(login,
index 16e7a8b310f1cd480f32e021b621469fdefaf4db..4182edf4285c3f75c8d5c6ce8000f68965e167b5 100644 (file)
@@ -2402,7 +2402,7 @@ VT100.prototype.toggleCursorBlinking = function() {
 };
 
 VT100.prototype.about = function() {
-  alert("VT100 Terminal Emulator " + "2.10 (revision 232)" +
+  alert("VT100 Terminal Emulator " + "2.10 (revision 233)" +
         "\nCopyright 2008-2010 by Markus Gutschke\n" +
         "For more information check http://shellinabox.com");
 };
index a60f419e4f2d3722e70d53f4c0105cd2f39bcf6f..49a51a77ca32d904fa1a3c94110d4e59d33283e5 100644 (file)
@@ -168,9 +168,8 @@ static int (*x_misc_conv)(int, const struct pam_message **,
 #endif
 
 // MacOS X has a somewhat unusual definition of getgrouplist() which can
-// trigger a compile warning. Unfortunately, there is no good feature test
-// for this particular problem.
-#if defined(__APPLE__) && defined(__MACH__)
+// trigger a compile warning.
+#if defined(HAVE_GETGROUPLIST_TAKES_INTS)
 static int x_getgrouplist(const char *user, gid_t group,
                           gid_t *groups, int *ngroups) {
   return getgrouplist(user, (int)group, (int *)groups, ngroups);
index f0bed3d98a98843b4d5d8371ca58f7235b9e66db..0d214f03ff23c67c8b6d9a9b49ba0e0be3c443bb 100644 (file)
@@ -358,7 +358,7 @@ ShellInABox.prototype.extendContextMenu = function(entries, actions) {
 };
 
 ShellInABox.prototype.about = function() {
-  alert("Shell In A Box version " + "2.10 (revision 232)" +
+  alert("Shell In A Box version " + "2.10 (revision 233)" +
         "\nCopyright 2008-2010 by Markus Gutschke\n" +
         "For more information check http://shellinabox.com" +
         (typeof serverSupportsSSL != 'undefined' && serverSupportsSSL ?
index 5be1ca64f117ed7f5cabb5d7a91e280fb7b0f192..1716129e8ba9d6e05e4b93cea2f599627d4a1515 100644 (file)
@@ -634,6 +634,7 @@ static int shellInABoxHttpHandler(HttpConnection *http, void *arg,
       // client session.
       return dataHandler(http, arg, buf, len, url);
     }
+    UNUSED(rootPageSize);
     char *html            = stringPrintf(NULL, rootPageStart,
                                          enableSSL ? "true" : "false");
     serveStaticFile(http, "text/html", html, strrchr(html, '\000'));
@@ -846,6 +847,7 @@ static void parseArgs(int argc, char * const argv[]) {
   int verbosity            = MSG_DEFAULT;
   externalFiles            = newHashMap(destroyExternalFileHashEntry, NULL);
   HashMap *serviceTable    = newHashMap(destroyServiceHashEntry, NULL);
+  UNUSED(stylesSize);
   check(cssStyleSheet      = strdup(stylesStart));
 
   for (;;) {
@@ -1274,6 +1276,7 @@ int main(int argc, char * const argv[]) {
            "X-ShellInABox-Pid: %d\r\n"
            "Content-type: text/html; charset=utf-8\r\n\r\n",
            port, getpid());
+    UNUSED(cgiRootSize);
     printfUnchecked(cgiRootStart, port, cgiSessionKey);
     fflush(stdout);
     check(!NOINTR(close(fds[1])));
index 16e7a8b310f1cd480f32e021b621469fdefaf4db..4182edf4285c3f75c8d5c6ce8000f68965e167b5 100644 (file)
@@ -2402,7 +2402,7 @@ VT100.prototype.toggleCursorBlinking = function() {
 };
 
 VT100.prototype.about = function() {
-  alert("VT100 Terminal Emulator " + "2.10 (revision 232)" +
+  alert("VT100 Terminal Emulator " + "2.10 (revision 233)" +
         "\nCopyright 2008-2010 by Markus Gutschke\n" +
         "For more information check http://shellinabox.com");
 };
This page took 0.0544 seconds and 5 git commands to generate.