don't save the directory fd in c->pfd

scandir_fd already calls closedir, which in turns closes the fd
This commit is contained in:
Omar Polo 2021-04-25 12:19:06 +00:00
parent 11c986679a
commit e76f2c74b8
1 changed files with 1 additions and 2 deletions

View File

@ -778,10 +778,9 @@ open_dir(struct client *c)
break;
}
c->pfd = dirfd;
c->next = enter_handle_dirlist;
c->dirlen = scandir_fd(c->pfd, &c->dir,
c->dirlen = scandir_fd(dirfd, &c->dir,
root ? select_non_dotdot : select_non_dot,
alphasort);
if (c->dirlen == -1) {