[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: emacsclient horribly broken
From: |
Tim Van Holder |
Subject: |
Re: emacsclient horribly broken |
Date: |
Tue, 31 Oct 2006 11:02:16 +0100 |
On 10/31/06, Juanma Barranquero <address@hidden> wrote:
On 10/31/06, Tim Van Holder <address@hidden> wrote:
>
> My daily build from CVS currently fails because of (apparently
> Windows-centric) changes to lib-src/emacsclient.c.
Windows-based, not Windows-centric. I mean: I was doing the work on
Windows, but I tried to be compatible. Obviously I failed, though I'd
hesitate to call "horribly broken" to something you've been able to
fix with five lines of code. :)
Well it was broken, and because Windows was involved "horribly" came to mind :-D
> - a '}' outside of an #if/#endif block
Yeah, I moved this code around and left the "}" at the wrong place. Sorry.
> - <netinet/in.h> not included => lots of missing types and macros
I don't have a GNU/Linux at hand, so I cannot test this kind of thing.
Help much appreciated.
> - use of non-existent INVALID_SOCKET macro
My bad. I trusted Microsoft. I shouldn't.
> - ioctl(...FIONBIO...) used instead of the posix
> fcntl(...O_NONBLOCK...)
I try to be compatible between GNU/Linux, Windows, etc. Being POSIX is
not a goal.
That's fine - just not sure which of the two is most widespread in the
Unix world.
> + no headers/configury used for it; if
> FIONBIO is actually desirable, configure should be adjusted to
> check for <sys/filio.h> and <sys/ioctl.h>, so emacsclient can
> include the ones that exist
Please, send a patch for this.
Follows.
Note that configure already has a check for the availability of inet
sockets, which
you use - so I changed the HAVE_SOCKETS guard to use HAVE_INET_SOCKETS
too (not sure if both are needed, but seemed safe to require it).
--- configure.in 30 Oct 2006 08:30:00 +0100 1.415
+++ configure.in 31 Oct 2006 10:47:11 +0100
@@ -2686,7 +2686,7 @@ dnl Fixme: Not used. Should this be HAV
[Define to 1 if you have inet sockets.])
fi
-AC_CHECK_HEADERS(sys/ioctl.h)
+AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
if test -f /usr/lpp/X11/bin/smt.exp; then
AC_DEFINE(HAVE_AIX_SMT_EXP, 1,
--- emacsclient.c 31 Oct 2006 10:53:19 +0100 1.79
+++ emacsclient.c 31 Oct 2006 10:57:49 +0100
@@ -28,6 +28,7 @@ Boston, MA 02110-1301, USA. */
#ifdef WINDOWSNT
#define HAVE_SOCKETS
+#define HAVE_INET_SOCKETS
#define NO_SOCKETS_IN_FILE_SYSTEM
#endif
@@ -39,7 +40,13 @@ Boston, MA 02110-1301, USA. */
typedef unsigned long IOCTL_BOOL_ARG;
#else
# include <netinet/in.h>
-# include <sys/ioctl.h>
+/* FIONBIO can be in either sys/ioctl.h or sys/filio.h */
+# if HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+# endif
+# if HAVE_SYS_FILIO_H
+# include <sys/ioctl.h>
+# endif
# define INVALID_SOCKET -1
# define HSOCKET int
# define CLOSE_SOCKET close
@@ -259,7 +266,7 @@ fail (argc, argv)
}
-#if !defined (HAVE_SOCKETS)
+#if !defined (HAVE_SOCKETS) || !defined(HAVE_INET_SOCKETS)
int
main (argc, argv)
@@ -798,7 +805,7 @@ main (argc, argv)
return EXIT_SUCCESS;
}
-#endif /* HAVE_SOCKETS */
+#endif /* HAVE_SOCKETS && HAVE_INET_SOCKETS */
#ifndef HAVE_STRERROR
char *
- emacsclient horribly broken, Tim Van Holder, 2006/10/31
- Re: emacsclient horribly broken, Juanma Barranquero, 2006/10/31
- Re: emacsclient horribly broken,
Tim Van Holder <=
- Re: emacsclient horribly broken, Jan Djärv, 2006/10/31
- Re: emacsclient horribly broken, Juanma Barranquero, 2006/10/31
- Re: emacsclient horribly broken, Kim F. Storm, 2006/10/31
- Re: emacsclient horribly broken, Juanma Barranquero, 2006/10/31
- Re: emacsclient horribly broken, Jan Djärv, 2006/10/31
- Re: emacsclient horribly broken, Juanma Barranquero, 2006/10/31