diff options
| author | 2015-05-07 08:53:32 +0000 | |
|---|---|---|
| committer | 2015-05-07 08:53:32 +0000 | |
| commit | f4ce75d227baed03d13911d26f451a7294b81b3e (patch) | |
| tree | 5529cccce647e880c8a39be0124534d12c7592e2 /sys/dev/diskmap.c | |
| parent | array.h can be local to window-choose.c now. (diff) | |
| download | wireguard-openbsd-f4ce75d227baed03d13911d26f451a7294b81b3e.tar.xz wireguard-openbsd-f4ce75d227baed03d13911d26f451a7294b81b3e.zip | |
Pass a thread pointer instead of its file descriptor table to getvnode(9).
Input and ok millert@
Diffstat (limited to 'sys/dev/diskmap.c')
| -rw-r--r-- | sys/dev/diskmap.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/diskmap.c b/sys/dev/diskmap.c index 2b54b5c4c21..6086384da6b 100644 --- a/sys/dev/diskmap.c +++ b/sys/dev/diskmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diskmap.c,v 1.10 2015/03/14 03:38:46 jsg Exp $ */ +/* $OpenBSD: diskmap.c,v 1.11 2015/05/07 08:53:33 mpi Exp $ */ /* * Copyright (c) 2009, 2010 Joel Sing <jsing@openbsd.org> @@ -78,12 +78,12 @@ diskmapioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) goto invalid; /* Attempt to open actual device. */ + if ((error = getvnode(p, fd, &fp)) != 0) + goto invalid; + fdp = p->p_fd; fdplock(fdp); - if ((error = getvnode(fdp, fd, &fp)) != 0) - goto bad; - ndp.ni_segflg = UIO_SYSSPACE; ndp.ni_dirfd = AT_FDCWD; ndp.ni_dirp = devname; |
