aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>2003-01-12 01:37:13 +0000
committerMatthew Dillon <dillon@FreeBSD.org>2003-01-12 01:37:13 +0000
commitcd72f2180bfff020d03180e6eba1c3a0e0125468 (patch)
tree19da0d56c468b8e0f6d0361d7d39157f561aa69f /usr.bin
parent1bd6f83d4d49a87f27dbfe50f9717a182e9f1f47 (diff)
downloadsrc-cd72f2180bfff020d03180e6eba1c3a0e0125468.tar.gz
src-cd72f2180bfff020d03180e6eba1c3a0e0125468.zip
Change struct file f_data to un_data, a union of the correct struct
pointer types, and remove a huge number of casts from code using it. Change struct xfile xf_data to xun_data (ABI is still compatible). If we need to add a #define for f_data and xf_data we can, but I don't think it will be necessary. There are no operational changes in this commit.
Notes
Notes: svn path=/head/; revision=109123
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/fstat/fstat.c10
-rw-r--r--usr.bin/sockstat/sockstat.c4
2 files changed, 6 insertions, 8 deletions
diff --git a/usr.bin/fstat/fstat.c b/usr.bin/fstat/fstat.c
index eb81388e69bb..d41011a4e8ed 100644
--- a/usr.bin/fstat/fstat.c
+++ b/usr.bin/fstat/fstat.c
@@ -381,23 +381,21 @@ dofiles(kp)
continue;
}
if (file.f_type == DTYPE_VNODE)
- vtrans((struct vnode *)file.f_data, i, file.f_flag);
+ vtrans(file.un_data.vnode, i, file.f_flag);
else if (file.f_type == DTYPE_SOCKET) {
if (checkfile == 0)
- socktrans((struct socket *)file.f_data, i);
+ socktrans(file.un_data.socket, i);
}
#ifdef DTYPE_PIPE
else if (file.f_type == DTYPE_PIPE) {
if (checkfile == 0)
- pipetrans((struct pipe *)file.f_data, i,
- file.f_flag);
+ pipetrans(file.un_data.pipe, i, file.f_flag);
}
#endif
#ifdef DTYPE_FIFO
else if (file.f_type == DTYPE_FIFO) {
if (checkfile == 0)
- vtrans((struct vnode *)file.f_data, i,
- file.f_flag);
+ vtrans(file.un_data.vnode, i, file.f_flag);
}
#endif
else {
diff --git a/usr.bin/sockstat/sockstat.c b/usr.bin/sockstat/sockstat.c
index 63b9058f8910..b7b22ecfa316 100644
--- a/usr.bin/sockstat/sockstat.c
+++ b/usr.bin/sockstat/sockstat.c
@@ -470,9 +470,9 @@ display(void)
"LOCAL ADDRESS", "FOREIGN ADDRESS");
setpassent(1);
for (xf = xfiles, n = 0; n < nxfiles; ++n, ++xf) {
- hash = (int)((uintptr_t)xf->xf_data % HASHSIZE);
+ hash = (int)((uintptr_t)xf->xun_data.generic % HASHSIZE);
for (s = sockhash[hash]; s != NULL; s = s->next)
- if (s->socket == xf->xf_data)
+ if (s->socket == xf->xun_data.socket)
break;
if (s == NULL)
continue;