summaryrefslogtreecommitdiff
path: root/sysutils/open-vm-tools/patches/patch-bc
blob: 8bf40f09ff32e8d3adbc97bc1328d59318c8abea (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
$NetBSD: patch-bc,v 1.2 2008/08/31 06:36:48 scottr Exp $

--- lib/misc/posixPosix.c.orig	2008-08-08 02:01:54.000000000 -0500
+++ lib/misc/posixPosix.c
@@ -50,7 +50,7 @@
 #include <sys/param.h>
 #include <sys/mount.h>
 #include <CoreFoundation/CoreFoundation.h>
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__NetBSD__)
 #include <sys/param.h>
 #include <sys/mount.h>
 #elif !defined(N_PLAT_NLM)
@@ -77,6 +77,7 @@
 # endif
 
 #include "vmware.h"
+#include "vm_atomic.h"
 #include "posixInt.h"
 #if defined(sun)
 #include "hashTable.h" // For setenv emulation
@@ -1578,7 +1579,7 @@ GetpwInternal(struct passwd *pw)  // IN:
    spw.pw_gecos = NULL;
    free(spw.pw_shell);
    spw.pw_shell = NULL;
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__)
    free(spw.pw_class);
    spw.pw_class = NULL;
 #endif
@@ -1586,10 +1587,12 @@ GetpwInternal(struct passwd *pw)  // IN:
    /* Fill out structure with new values. */
    spw.pw_uid = pw->pw_uid;
    spw.pw_gid = pw->pw_gid;
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__)
    spw.pw_change = pw->pw_change;
    spw.pw_expire = pw->pw_expire;
+# if defined(__FreeBSD__)
    spw.pw_fields = pw->pw_fields;
+# endif
 #endif
 
 #if !defined(sun)
@@ -1617,7 +1620,7 @@ GetpwInternal(struct passwd *pw)  // IN:
        (spw.pw_shell = Unicode_Alloc(pw->pw_shell, STRING_ENCODING_DEFAULT)) == NULL) {
       goto exit;
    }
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__)
    if (pw->pw_class &&
        (spw.pw_class = Unicode_Alloc(pw->pw_class, STRING_ENCODING_DEFAULT)) == NULL) {
       goto exit;
@@ -1634,7 +1637,7 @@ exit:
 }
 
 
-#if !defined(sun) // {
+#if !defined(sun) && !defined(__NetBSD__) // {
 
 /*
  *----------------------------------------------------------------------
@@ -1902,7 +1905,7 @@ PasswdCopy(struct passwd *orig, // IN
    if (!CopyFieldIntoBuf(orig->pw_shell, &new->pw_shell, &buf, &bufLen)) {
       return NULL;
    }
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__NetBSD__)
    if (!CopyFieldIntoBuf(orig->pw_class, &new->pw_class, &buf, &bufLen)) {
       return NULL;
    }
@@ -2647,7 +2650,7 @@ Posix_Getgrnam_r(ConstUnicode name,    /
 
 #if !defined(sun) // {
 
-#if !defined(__APPLE__) && !defined(__FreeBSD__) // {
+#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) // {
 /*
  *----------------------------------------------------------------------
  *
@@ -3030,7 +3033,7 @@ Posix_Fprintf(FILE *stream,
 }
 
 
-#endif // } !defined(__APPLE__) && !defined(__FreeBSD)
+#endif // } !defined(__APPLE__) && !defined(__FreeBSD) && !defined(__NetBSD__)
 
 
 #else  // } !defined(sun) {