2013-09-26 17:14:40 +02:00

54 lines
1.4 KiB
Plaintext

$NetBSD: patch-aj,v 1.6 2004/04/18 17:11:08 jmmv Exp $
--- src/Listener.c++.orig 2003-01-20 01:37:29.000000000 +0100
+++ src/Listener.c++
@@ -22,6 +22,8 @@
#include "Listener.h"
+#include <stdio.h>
+#include <stdlib.h>
#include <assert.h>
#include <fcntl.h>
#include <sys/types.h>
@@ -32,6 +34,7 @@
#include <rpc/clnt.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
+#include <sys/param.h>
#include <sys/stat.h>
#include <sys/un.h>
#include <unistd.h>
@@ -205,11 +208,11 @@ Listener::create_local_client(TCP_Client
#ifdef HAVE_UNSETENV
unsetenv("TMPDIR");
#else
- putenv("TMPDIR=");
+ putenv("TMPDIR=/tmp");
#endif
char *tmpfile = tempnam("/tmp", ".fam");
-#ifdef HAVE_SOCKADDR_SUN_LEN
+#ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
sockaddr_un sun = { sizeof(sockaddr_un), AF_UNIX, "" };
#else
sockaddr_un sun = { AF_UNIX, "" };
@@ -283,7 +286,7 @@ Listener::accept_localclient(int ofd, vo
// Get the new socket.
-#ifdef HAVE_SOCKADDR_SUN_LEN
+#ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
struct sockaddr_un sun = { sizeof(sockaddr_un), AF_UNIX, "" };
#else
struct sockaddr_un sun = { AF_UNIX, "" };
@@ -349,7 +352,7 @@ Listener::accept_localclient(int ofd, vo
void
Listener::dirty_ugly_hack()
{
-#ifdef HAVE_SOCKADDR_SUN_LEN
+#ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
static sockaddr_un sun = { sizeof (sockaddr_un), AF_UNIX, "/tmp/.fam_socket" };
#else
static sockaddr_un sun = { AF_UNIX, "/tmp/.fam_socket" };