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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
|
boot/ChangeLog
2005-09-01 Thomas Schwinge <tschwinge@gnu.org>
* boot.c (boot_script_exec_cmd): Fix invalid lvalues.
libdiskfs/ChangeLog
2005-09-01 Thomas Schwinge <tschwinge@gnu.org>
* priv.h: Include <argp.h>.
nfsd/ChangeLog
2005-09-01 Thomas Schwinge <tschwinge@gnu.org>
* loop.c (server_loop): Fix invalid lvalues.
pfinet/ChangeLog
2005-09-01 Thomas Schwinge <tschwinge@gnu.org>
* glue-include/asm/system.h (xchg): Fix invalid lvalue.
* linux-src/net/ipv4/tcp_ipv4.c (tcp_v4_rst_req): Don't use ?: as a
lvalue.
ufs/ChangeLog
2005-09-01 Thomas Schwinge <tschwinge@gnu.org>
* dir.h (DIRECT_NAMELEN): Don't use ?: as a lvalue.
ufs-utils/ChangeLog
2005-09-01 Thomas Schwinge <tschwinge@gnu.org>
* mkfs.c (parse_opt): Move UP's functionality into UP_INT in order to
fix invalid lvalues.
utils/ChangeLog
2005-09-01 Thomas Schwinge <tschwinge@gnu.org>
* ps.c (current_tty_name): Don't declare as `static'.
* rpctrace.c (print_contents): Don't use ?: as a lvalue.
serverboot/ChageLog
2005-08-13 Alfred M. Szmidt <ams@gnu.org>
* kalloc.c: #include <malloc.h>
(init_hook, malloc_hook, free_hook): New functions.
(__malloc_initialize_hook): New variable.
(malloc, free): Functions removed.
diff -rN -u old-hurd-0-branch.1.tmp-1/boot/boot.c new-hurd-0-branch.1.tmp-1/boot/boot.c
--- old-hurd-0-branch.1.tmp-1/boot/boot.c 2005-09-01 19:18:01.293715312 +0200
+++ new-hurd-0-branch.1.tmp-1/boot/boot.c 2005-09-01 19:18:01.307713184 +0200
@@ -367,11 +367,17 @@
str_start = ((vm_address_t) arg_pos
+ (argc + 2) * sizeof (char *) + sizeof (integer_t));
p = args + ((vm_address_t) arg_pos & (vm_page_size - 1));
- *((int *) p)++ = argc;
+ *(int *) p = argc;
+ p = (char *) ((int *) p + 1);
for (i = 0; i < argc; i++)
- *((char **) p)++ = argv[i] - strings + (char *) str_start;
- *((char **) p)++ = 0;
- *((char **) p)++ = 0;
+ {
+ *(char **) p = argv[i] - strings + (char *) str_start;
+ p = (char *) ((char **) p + 1);
+ }
+ *(char **) p = 0;
+ p = (char *) ((char **) p + 1);
+ *(char **) p = 0;
+ p = (char *) ((char **) p + 1);
memcpy (p, strings, stringlen);
bzero (args, (vm_offset_t) arg_pos & (vm_page_size - 1));
vm_write (task, trunc_page ((vm_offset_t) arg_pos), (vm_address_t) args,
diff -rN -u old-hurd-0-branch.1.tmp-1/libdiskfs/priv.h new-hurd-0-branch.1.tmp-1/libdiskfs/priv.h
--- old-hurd-0-branch.1.tmp-1/libdiskfs/priv.h 2005-09-01 19:18:01.291715616 +0200
+++ new-hurd-0-branch.1.tmp-1/libdiskfs/priv.h 2005-09-01 19:18:01.737647824 +0200
@@ -26,6 +26,7 @@
#include <hurd/iohelp.h>
#include <hurd/port.h>
#include <assert.h>
+#include <argp.h>
#include "diskfs.h"
diff -rN -u old-hurd-0-branch.1.tmp-1/nfsd/loop.c new-hurd-0-branch.1.tmp-1/nfsd/loop.c
--- old-hurd-0-branch.1.tmp-1/nfsd/loop.c 2005-09-01 19:18:01.291715616 +0200
+++ new-hurd-0-branch.1.tmp-1/nfsd/loop.c 2005-09-01 19:18:01.318711512 +0200
@@ -77,7 +77,7 @@
/* This transacation has already completed. */
goto repost_reply;
- r = (int *) rbuf = malloc (MAXIOSIZE);
+ r = (int *) (rbuf = malloc (MAXIOSIZE));
if (ntohl (*p) != RPC_MSG_VERSION)
{
@@ -173,7 +173,7 @@
if (amt > MAXIOSIZE)
{
free (rbuf);
- r = (int *) rbuf = malloc (amt);
+ r = (int *) (rbuf = malloc (amt));
}
}
diff -rN -u old-hurd-0-branch.1.tmp-1/pfinet/glue-include/asm/system.h new-hurd-0-branch.1.tmp-1/pfinet/glue-include/asm/system.h
--- old-hurd-0-branch.1.tmp-1/pfinet/glue-include/asm/system.h 2005-09-01 19:18:01.291715616 +0200
+++ new-hurd-0-branch.1.tmp-1/pfinet/glue-include/asm/system.h 2005-09-01 19:18:01.495684608 +0200
@@ -9,7 +9,7 @@
#define xchg(ptr, x) \
({ \
__typeof__ (*(ptr)) *_ptr = (ptr), _x = *_ptr; \
- (uintptr_t) *_ptr = (x); _x; \
+ *_ptr = (x); _x; \
})
#define mb() ((void) 0) /* memory barrier */
diff -rN -u old-hurd-0-branch.1.tmp-1/pfinet/linux-src/net/ipv4/tcp_ipv4.c new-hurd-0-branch.1.tmp-1/pfinet/linux-src/net/ipv4/tcp_ipv4.c
--- old-hurd-0-branch.1.tmp-1/pfinet/linux-src/net/ipv4/tcp_ipv4.c 2005-09-01 19:18:01.290715768 +0200
+++ new-hurd-0-branch.1.tmp-1/pfinet/linux-src/net/ipv4/tcp_ipv4.c 2005-09-01 19:18:01.512682024 +0200
@@ -1584,7 +1584,10 @@
after(TCP_SKB_CB(skb)->seq, req->rcv_isn+1))
return;
tcp_synq_unlink(tp, req, prev);
- (req->sk ? sk->ack_backlog : tp->syn_backlog)--;
+ if (req->sk)
+ sk->ack_backlog--;
+ else
+ tp->syn_backlog--;
req->class->destructor(req);
tcp_openreq_free(req);
diff -rN -u old-hurd-0-branch.1.tmp-1/ufs/dir.h new-hurd-0-branch.1.tmp-1/ufs/dir.h
--- old-hurd-0-branch.1.tmp-1/ufs/dir.h 2005-09-01 19:18:01.288716072 +0200
+++ new-hurd-0-branch.1.tmp-1/ufs/dir.h 2005-09-01 19:18:01.301714096 +0200
@@ -91,13 +91,13 @@
/* Return the namlen from a struct direct, paying attention to whether
this filesystem supports the type extension */
#if (BYTE_ORDER == LITTLE_ENDIAN)
-#define DIRECT_NAMLEN(dp) (direct_symlink_extension || swab_disk \
- ? (dp)->d_namlen \
- : (dp)->d_type)
+#define DIRECT_NAMLEN(dp) (*(direct_symlink_extension || swab_disk \
+ ? &(dp)->d_namlen \
+ : &(dp)->d_type))
#else
-#define DIRECT_NAMLEN(dp) (!direct_symlink_extension && swab_disk \
- ? (dp)->d_type \
- : (dp)->d_namlen)
+#define DIRECT_NAMLEN(dp) (*(!direct_symlink_extension && swab_disk \
+ ? &(dp)->d_type \
+ : &(dp)->d_namlen))
#endif
/*
diff -rN -u old-hurd-0-branch.1.tmp-1/ufs-utils/mkfs.c new-hurd-0-branch.1.tmp-1/ufs-utils/mkfs.c
--- old-hurd-0-branch.1.tmp-1/ufs-utils/mkfs.c 2005-09-01 19:18:01.287716224 +0200
+++ new-hurd-0-branch.1.tmp-1/ufs-utils/mkfs.c 2005-09-01 19:18:01.461689776 +0200
@@ -279,10 +279,8 @@
case 'N': Nflag = 1; break;
case 'O': Oflag = 1; break;
- /* Mark &VAR as being a uparam, and return a lvalue for VAR. */
-#define UP(var) (amarks_add (&uparams, &var), var)
- /* Record an integer uparam into VAR. */
-#define UP_INT(var) { int _i = atoi (arg); UP (var) = _i; }
+/* Mark &VAR as being a uparam, and set VAR. */
+#define UP_INT(var) { amarks_add (&uparams, &var); var = atoi (arg); }
case 'a': UP_INT (maxcontig); break;
case 'b': UP_INT (bsize); break;
diff -rN -u old-hurd-0-branch.1.tmp-1/utils/ps.c new-hurd-0-branch.1.tmp-1/utils/ps.c
--- old-hurd-0-branch.1.tmp-1/utils/ps.c 2005-09-01 19:18:01.286716376 +0200
+++ new-hurd-0-branch.1.tmp-1/utils/ps.c 2005-09-01 19:18:01.452691144 +0200
@@ -249,7 +249,7 @@
}
/* Returns the name of the current controlling terminal. */
- static const char *current_tty_name()
+ const char *current_tty_name()
{
error_t err;
struct ps_tty *tty;
diff -rN -u old-hurd-0-branch.1.tmp-1/utils/rpctrace.c new-hurd-0-branch.1.tmp-1/utils/rpctrace.c
--- old-hurd-0-branch.1.tmp-1/utils/rpctrace.c 2005-09-01 19:18:01.285716528 +0200
+++ new-hurd-0-branch.1.tmp-1/utils/rpctrace.c 2005-09-01 19:18:01.454690840 +0200
@@ -616,11 +616,16 @@
name = MACH_MSG_TYPE_MOVE_SEND;
}
- (type->msgt_longform ? lt->msgtl_name : type->msgt_name) = name;
+ if (type->msgt_longform)
+ lt->msgtl_name = name;
+ else
+ type->msgt_name = name;
}
else if (newtypes[0] != name)
- (type->msgt_longform ? lt->msgtl_name : type->msgt_name)
- = newtypes[0];
+ if (type->msgt_longform)
+ lt->msgtl_name = newtypes[0];
+ else
+ type->msgt_name = newtypes[0];
}
else
print_data (name, data, nelt, eltsize);
===================================================================
RCS file: /cvsroot/hurd/cvsroot/hurd/hurd/serverboot/kalloc.c,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- hurd/serverboot/kalloc.c 1997/04/03 23:27:41 1.1
+++ hurd/serverboot/kalloc.c 2005/09/19 20:19:56 1.1.2.1
@@ -34,6 +34,14 @@
#include <mach.h>
#include <cthreads.h> /* for spin locks */
+#include <malloc.h> /* for malloc_hook/free_hook */
+
+static void init_hook (void);
+static void *malloc_hook (size_t size, const void *caller);
+static void free_hook (void *ptr, const void *caller);
+
+void (*__malloc_initialize_hook) (void) = init_hook;
+
#define DEBUG
@@ -250,12 +258,21 @@
}
}
-void *malloc(vm_size_t size)
+static void
+init_hook (void)
+{
+ __malloc_hook = malloc_hook;
+ __free_hook = free_hook;
+}
+
+static void *
+malloc_hook (size_t size, const void *caller)
{
- return (void *)kalloc(size);
+ return (void *) kalloc ((vm_size_t) size);
}
-void free(void *addr)
+static void
+free_hook (void *ptr, const void *caller)
{
/* Just ignore harmless attempts at cleanliness. */
/* panic("free not implemented"); */
|