summaryrefslogtreecommitdiff
path: root/sysutils/fam/patches/patch-aj
blob: 439d57274ed9367a01e0f3b12b75ab6b9ac28899 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
$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" };