Skip to content

Commit

Permalink
freebsd: fix build on non-intel archs (libuv#4276)
Browse files Browse the repository at this point in the history
KINFO_FILE_SIZE is only defined on Intel archs.

Fixes: libuv#4274
  • Loading branch information
devnexen authored Jan 9, 2024
1 parent 160cd56 commit a407b23
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/unix/kqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,13 @@ static void uv__fs_event(uv_loop_t* loop, uv__io_t* w, unsigned int fflags) {

if (handle->event_watcher.fd != -1 &&
(!uv__fstat(handle->event_watcher.fd, &statbuf) && !(statbuf.st_mode & S_IFDIR))) {
kf.kf_structsize = KINFO_FILE_SIZE;
/* we are purposely not using KINFO_FILE_SIZE here
* as it is not available on non intl archs
* and here it gives 1392 too on intel.
* anyway, the man page also mentions we can proceed
* this way.
*/
kf.kf_structsize = sizeof(kf);
if (fcntl(handle->event_watcher.fd, F_KINFO, &kf) == 0)
path = uv__basename_r(kf.kf_path);
}
Expand Down

0 comments on commit a407b23

Please sign in to comment.