Skip to content

Commit 799d779

Browse files
committed
apply OpenHandles path from jurajlutter
1 parent 96ff4d1 commit 799d779

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

providers/freebsd/process_freebsd_cgo.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ unsigned int countFileStats(struct filestat_list *head) {
6161
void copyFileStats(struct filestat_list *head, struct filestat *out, unsigned int size) {
6262
unsigned int index = 0;
6363
struct filestat *fst;
64+
if (size == 0) {
65+
return;
66+
}
6467
STAILQ_FOREACH(fst, head, next) {
65-
if (!size) {
66-
break;
67-
}
6868
memcpy(out, fst, sizeof(*fst));
6969
++out;
7070
--size;
@@ -326,7 +326,7 @@ func (p *process) OpenHandles() ([]string, error) {
326326
names := make([]string, 0, len(files))
327327

328328
for _, file := range files {
329-
if file.fs_uflags == 0 {
329+
if file.fs_type == 1 {
330330
names = append(names, C.GoString(file.fs_path))
331331
}
332332
}

0 commit comments

Comments
 (0)