summaryrefslogtreecommitdiff
blob: 90a82d98a6dce04a3aa6c6e466323300f392edcf (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
--- a/compat_sun.h
+++ b/compat_sun.h
@@ -1,6 +1,3 @@
-/* __unused is a gcc'ism. */
-#define	__unused
-
 #include <stdio.h>
 #include <stdarg.h>
 
--- a/cpdup.c
+++ b/cpdup.c
@@ -127,8 +127,8 @@
 static void hltdelete(struct hlink *);
 static void hltsetdino(struct hlink *, ino_t);
 static int YesNo(const char *path);
-static int xrename(const char *src, const char *dst, u_long flags);
-static int xlink(const char *src, const char *dst, u_long flags);
+static int xrename(const char *src, const char *dst, unsigned long flags);
+static int xlink(const char *src, const char *dst, unsigned long flags);
 static int xremove(struct HostConf *host, const char *path);
 static int DoCopy(copy_info_t info, struct stat *stat1, int depth);
 static int ScanDir(List *list, struct HostConf *host, const char *path,
@@ -1648,7 +1648,7 @@
  */
 
 static int
-xrename(const char *src, const char *dst, u_long flags)
+xrename(const char *src, const char *dst, unsigned long flags)
 {
     int r;
 
@@ -1663,7 +1663,7 @@
 }
 
 static int
-xlink(const char *src, const char *dst, u_long flags)
+xlink(const char *src, const char *dst, unsigned long flags)
 {
     int r;
 #ifdef _ST_FLAGS_PRESENT_
--- a/cpdup.h
+++ b/cpdup.h
@@ -39,7 +39,6 @@
 #define __printflike(a,b)
 #define __printf0like(a,b)
 #define __aligned(x)
-#define __unused
 #endif
 
 void logstd(const char *ctl, ...) __printflike(1, 2);
--- a/hclink.c
+++ b/hclink.c
@@ -73,7 +73,7 @@
 }
 
 static int
-rc_badop(hctransaction_t trans __unused, struct HCHead *head)
+rc_badop(hctransaction_t trans, struct HCHead *head)
 {
     head->error = EOPNOTSUPP;
     return(0);
--- a/hcproto.c
+++ b/hcproto.c
@@ -10,6 +10,8 @@
 #include "hclink.h"
 #include "hcproto.h"
 
+#include <bsd/string.h>
+
 static int hc_decode_stat(hctransaction_t trans, struct stat *, struct HCHead *);
 static int hc_decode_stat_item(struct stat *st, struct HCLeaf *item);
 static int rc_encode_stat(hctransaction_t trans, struct stat *);
@@ -1503,7 +1505,7 @@
  * CHFLAGS
  */
 int
-hc_chflags(struct HostConf *hc, const char *path, u_long flags)
+hc_chflags(struct HostConf *hc, const char *path, unsigned long flags)
 {
     hctransaction_t trans;
     struct HCHead *head;
@@ -1535,7 +1537,7 @@
 {
     struct HCLeaf *item;
     const char *path = NULL;
-    u_long flags = 0;
+    unsigned long flags = 0;
     int rc;
 
     FOR_EACH_ITEM(item, trans, head) {
@@ -1544,7 +1546,7 @@
 	    path = HCC_STRING(item);
 	    break;
 	case LC_FILEFLAGS:
-	    flags = (u_long)HCC_INT64(item);
+	    flags = (unsigned long)HCC_INT64(item);
 	    break;
 	}
     }
@@ -1846,7 +1848,7 @@
 }
 
 static int
-rc_geteuid(hctransaction_t trans, struct HCHead *head __unused)
+rc_geteuid(hctransaction_t trans, struct HCHead *head)
 {
     hcc_leaf_int32(trans, LC_UID, geteuid());
     return (0);
@@ -1920,7 +1922,7 @@
 }
 
 static int
-rc_getgroups(hctransaction_t trans, struct HCHead *head __unused)
+rc_getgroups(hctransaction_t trans, struct HCHead *head)
 {
     int count, i;
     gid_t *gidlist;
--- a/hcproto.h
+++ b/hcproto.h
@@ -105,7 +105,7 @@
 int hc_chmod(struct HostConf *hc, const char *path, mode_t mode);
 int hc_mknod(struct HostConf *hc, const char *path, mode_t mode, dev_t rdev);
 int hc_link(struct HostConf *hc, const char *name1, const char *name2);
-int hc_chflags(struct HostConf *hc, const char *path, u_long flags);
+int hc_chflags(struct HostConf *hc, const char *path, unsigned long flags);
 int hc_readlink(struct HostConf *hc, const char *path, char *buf, int bufsiz);
 mode_t hc_umask(struct HostConf *hc, mode_t numask);
 int hc_symlink(struct HostConf *hc, const char *name1, const char *name2);