aix: re-enable fs watch facility
On AIX, watch feature depends on AHAFS based Event infrastructure. While in principle the watch use case is same across platforms, there are subtle differences in the way AIX deals with this, with few behavioral changes (external). This commit opens up the AIX code for watch feature which was masked under a macro HAVE_SYS_AHAFS_EVPRODS_H and addresses an assertion failure on folder watch. PR-URL: https://github.com/libuv/libuv/pull/1156 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This commit is contained in:
parent
12bfad9c6d
commit
fb0f87b6d7
@ -316,7 +316,11 @@ test_run_tests_CFLAGS += -D_UNIX03_THREADS \
|
||||
endif
|
||||
|
||||
if AIX
|
||||
libuv_la_CFLAGS += -D_ALL_SOURCE -D_XOPEN_SOURCE=500 -D_LINUX_SOURCE_COMPAT -D_THREAD_SAFE
|
||||
libuv_la_CFLAGS += -D_ALL_SOURCE \
|
||||
-D_XOPEN_SOURCE=500 \
|
||||
-D_LINUX_SOURCE_COMPAT \
|
||||
-D_THREAD_SAFE \
|
||||
-DHAVE_SYS_AHAFS_EVPRODS_H
|
||||
include_HEADERS += include/uv-aix.h
|
||||
libuv_la_SOURCES += src/unix/aix.c
|
||||
endif
|
||||
|
||||
@ -758,6 +758,13 @@ static void uv__ahafs_event(uv_loop_t* loop, uv__io_t* event_watch, unsigned int
|
||||
|
||||
assert((bytes >= 0) && "uv__ahafs_event - Error reading monitor file");
|
||||
|
||||
/* In file / directory move cases, AIX Event infrastructure
|
||||
* produces a second event with no data.
|
||||
* Ignore it and return gracefully.
|
||||
*/
|
||||
if(bytes == 0)
|
||||
return;
|
||||
|
||||
/* Parse the data */
|
||||
if(bytes > 0)
|
||||
rc = uv__parse_data(result_data, &events, handle);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user