Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/dialects/darwin/dproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ static void process_fds(struct lsof_context *ctx, /* context */
{
int i, isock, nb, nf;
struct proc_fdinfo *fdp;
retry:
/*
* Make sure an FD buffer has been allocated.
*/
Expand Down Expand Up @@ -457,6 +458,11 @@ static void process_fds(struct lsof_context *ctx, /* context */
link_lfile(ctx);
return;
}
/* A full buffer may omit descriptors opened since the task-info query. */
if (nb + sizeof(struct proc_fdinfo) > NbFds) {
n = NbFds / sizeof(struct proc_fdinfo) + 32;
goto retry;
}
nf = (int)(nb / sizeof(struct proc_fdinfo));
/*
* Loop through the file descriptors.
Expand Down
Loading