diff --git a/Makefile.am b/Makefile.am index 2637ef3f..036464e7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/src/unix/aix.c b/src/unix/aix.c index 80d63301..1d2cd4a8 100644 --- a/src/unix/aix.c +++ b/src/unix/aix.c @@ -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); diff --git a/uv.gyp b/uv.gyp index 60fd5c12..49d5d22f 100644 --- a/uv.gyp +++ b/uv.gyp @@ -277,6 +277,7 @@ '_XOPEN_SOURCE=500', '_LINUX_SOURCE_COMPAT', '_THREAD_SAFE', + 'HAVE_SYS_AHAFS_EVPRODS_H', ], 'link_settings': { 'libraries': [