I've received a bug report about gnuserv. This referrs to the
stand-alone gnuserv maintained by Martin Schwenke, who forwarded this
to xemacsbugs as it is our code.
I've tried to create port of gnuserv-3.12.1 for FreeBSD and have
meet
two problems:
1) gnuserv creates unix socket with wrong name
/tmp/gsrvdir*/gsr. Here patch to fix this problem:
--- gnuserv.c~ Thu Jan 25 13:41:48 2001
+++ gnuserv.c Sat Feb 10 18:00:44 2001
@@ -790,7 +790,7 @@
+ strlen (server.sun_path) + 1);
server.sun_len = bindlen;
#else
- bindlen = strlen (server.sun_path) + sizeof (server.sun_family);
+ bindlen = strlen (server.sun_path) + 1 + sizeof (server.sun_family);
#endif
if (bind(ls,(struct sockaddr *)&server,bindlen) < 0)
The code in question is:
,----
| #ifdef HAVE_SOCKADDR_SUN_LEN
| /* See W. R. Stevens "Advanced Programming in the Unix Environment"
| p. 502 */
| bindlen = (sizeof (server.sun_len) + sizeof (server.sun_family)
| + strlen (server.sun_path) + 1);
| server.sun_len = bindlen;
| #else
| bindlen = strlen (server.sun_path) + sizeof (server.sun_family);
| #endif
|
| if (bind(ls,(struct sockaddr *)&server,bindlen) < 0)
| {
`----
I don't have the Stevens handy. Does anybody know whether the length
should include the string terminating 0 or not?
I have never seen /tmp/gsrvdir*/gsr on Linux or Solaris. Could
somebody check on FreeBSD?
Gunnar