uv: upgrade to 224584c
authorBen Noordhuis <info@bnoordhuis.nl>
Thu, 10 Nov 2011 19:10:54 +0000 (20:10 +0100)
committerBen Noordhuis <info@bnoordhuis.nl>
Thu, 10 Nov 2011 19:10:54 +0000 (20:10 +0100)
deps/uv/include/uv-private/uv-unix.h
deps/uv/src/unix/internal.h
deps/uv/src/unix/sunos.c

index b07781f4068b123e19dbade66098882409a5dd15..21078fe36370701474ffff4ae3085908f1f292e1 100644 (file)
@@ -204,10 +204,14 @@ typedef void* uv_lib_t;
 #include <sys/port.h>
 #include <port.h>
 
-#define UV_FS_EVENT_PRIVATE_FIELDS \
+#ifdef PORT_SOURCE_FILE
+# define UV_FS_EVENT_PRIVATE_FIELDS \
   ev_io event_watcher; \
   uv_fs_event_cb cb; \
-  file_obj_t fo; \
+  file_obj_t fo;
+#else /* !PORT_SOURCE_FILE */
+# define UV_FS_EVENT_PRIVATE_FIELDS
+#endif
 
 #else
 
index 0ab8ba9579f1e55c300e0abed4f075bbdbe6cd0e..12ab62177c1fd38a7007cb8e211c70ff408fe9ec 100644 (file)
 
 #include <stddef.h> /* offsetof */
 
+#undef HAVE_FUTIMES
+#undef HAVE_PIPE2
+#undef HAVE_ACCEPT4
+#undef HAVE_KQUEUE
+#undef HAVE_PORTS_FS
+
 #if defined(__linux__)
 
 #include <linux/version.h>
 
 #endif /* __linux__ */
 
+#if defined(__sun)
+# include <sys/port.h>
+# include <port.h>
+# ifdef PORT_SOURCE_FILE
+#  define HAVE_PORTS_FS 1
+# endif
+#endif /* __sun */
+
 #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun)
 # define HAVE_FUTIMES 1
 #endif
index f53122079865ea88e760ae69e80649097a026f53..725e5603ea1afea7a886da77806be8d678bf9a8e 100644 (file)
 
 #include <sys/loadavg.h>
 #include <sys/time.h>
-#include <sys/port.h>
 #include <unistd.h>
 #include <kstat.h>
-#include <port.h>
+
+#if HAVE_PORTS_FS
+# include <sys/port.h>
+# include <port.h>
+#endif
 
 
 uint64_t uv_hrtime() {
@@ -85,6 +88,7 @@ void uv_loadavg(double avg[3]) {
 }
 
 
+#if HAVE_PORTS_FS
 static void uv__fs_event_rearm(uv_fs_event_t *handle) {
   if (port_associate(handle->fd,
                      PORT_SOURCE_FILE,
@@ -173,3 +177,21 @@ void uv__fs_event_destroy(uv_fs_event_t* handle) {
   handle->filename = NULL;
   handle->fo.fo_name = NULL;
 }
+
+#else /* !HAVE_PORTS_FS */
+
+int uv_fs_event_init(uv_loop_t* loop,
+                     uv_fs_event_t* handle,
+                     const char* filename,
+                     uv_fs_event_cb cb,
+                     int flags) {
+  uv__set_sys_error(loop, ENOSYS);
+  return -1;
+}
+
+
+void uv__fs_event_destroy(uv_fs_event_t* handle) {
+  assert(0 && "unreachable"); /* should never be called */
+}
+
+#endif /* HAVE_PORTS_FS */