mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-14 14:55:41 +00:00
Make the pseudo-driver for "/dev/fd/*" handle fd's larger than 255.
PR: 25936
This commit is contained in:
parent
15b6f00fd1
commit
71d033119f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=74523
@ -1315,7 +1315,7 @@ fdopen(dev, mode, type, p)
|
||||
* actions in dupfdopen below. Other callers of vn_open or VOP_OPEN
|
||||
* will simply report the error.
|
||||
*/
|
||||
p->p_dupfd = minor(dev);
|
||||
p->p_dupfd = dev2unit(dev);
|
||||
return (ENODEV);
|
||||
}
|
||||
|
||||
@ -1478,6 +1478,13 @@ fildesc_clone(void *arg, char *name, int namelen, dev_t *dev)
|
||||
return;
|
||||
if (u <= 2)
|
||||
return;
|
||||
/* Don't clone higher than it makes sense */
|
||||
if (u >= maxfilesperproc)
|
||||
return;
|
||||
/* And don't clone higher than our minors will support */
|
||||
if (u > 0xffffff)
|
||||
return;
|
||||
u = unit2minor(u);
|
||||
*dev = make_dev(&fildesc_cdevsw, u, UID_BIN, GID_BIN, 0666, name);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user