SCCS-vsn: sys/kern/kern_descrip.c 5.16
-/* kern_descrip.c 5.15 82/10/22 */
+/* kern_descrip.c 5.16 82/10/23 */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
label_t lqsave;
obits[0] = obits[1] = obits[2] = 0;
label_t lqsave;
obits[0] = obits[1] = obits[2] = 0;
- if (uap->nd >= NOFILE) {
- u.u_error = EINVAL;
- goto done;
- }
+ if (uap->nd > NOFILE)
+ uap->nd = NOFILE; /* forgiving, if slightly wrong */
#define getbits(name, x) \
if (uap->name) { \
#define getbits(name, x) \
if (uap->name) { \
done:
#define putbits(name, x) \
if (uap->name) { \
done:
#define putbits(name, x) \
if (uap->name) { \
- if (copyout((caddr_t)obits[x], (caddr_t)uap->name, \
+ if (copyout((caddr_t)&obits[x], (caddr_t)uap->name, \
sizeof (obits[x]))) \
u.u_error = EFAULT; \
}
sizeof (obits[x]))) \
u.u_error = EFAULT; \
}