freebsd: fix build on non-intel archs (#4276)
KINFO_FILE_SIZE is only defined on Intel archs. Fixes: https://github.com/libuv/libuv/issues/4274
This commit is contained in:
parent
160cd5629e
commit
a407b232f0
@ -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 &&
|
if (handle->event_watcher.fd != -1 &&
|
||||||
(!uv__fstat(handle->event_watcher.fd, &statbuf) && !(statbuf.st_mode & S_IFDIR))) {
|
(!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)
|
if (fcntl(handle->event_watcher.fd, F_KINFO, &kf) == 0)
|
||||||
path = uv__basename_r(kf.kf_path);
|
path = uv__basename_r(kf.kf_path);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user