Fix reference counting for file descriptors

Update #3132.
This commit is contained in:
Sebastian Huber
2017-11-10 11:01:39 +01:00
parent b15a71914d
commit 72d5fa11a8
5 changed files with 29 additions and 1 deletions

View File

@@ -939,7 +939,9 @@ kern_kqueue(struct thread *td, int flags, struct filecaps *fcaps)
#endif /* __rtems__ */
finit(fp, FREAD | FWRITE, DTYPE_KQUEUE, kq, &kqueueops);
#ifndef __rtems__
fdrop(fp, td);
#endif /* __rtems__ */
td->td_retval[0] = fd;
return (0);