Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

sunos: fix !defined(PORT_SOURCE_FILE) build

  • Loading branch information...
commit 69ab328d9f387d029272fa4aee06ea72e7c9878e 1 parent 3164f1e
@bnoordhuis authored
View
10 include/uv-private/uv-sunos.h
@@ -25,12 +25,16 @@
#include <sys/port.h>
#include <port.h>
-#if defined(PORT_SOURCE_FILE)
-
-# define UV_PLATFORM_LOOP_FIELDS \
+/* For the sake of convenience and reduced #ifdef-ery in src/unix/sunos.c,
+ * add the fs_event fields even when this version of SunOS doesn't support
+ * file watching.
+ */
+#define UV_PLATFORM_LOOP_FIELDS \
uv__io_t fs_event_watcher; \
int fs_fd; \
+#if defined(PORT_SOURCE_FILE)
+
# define UV_PLATFORM_FS_EVENT_FIELDS \
file_obj_t fo; \
int fd; \
View
5 src/unix/internal.h
@@ -31,8 +31,6 @@
# define inline __inline
#endif
-#undef HAVE_PORTS_FS
-
#if __linux__
# include "linux/syscalls.h"
#endif /* __linux__ */
@@ -40,9 +38,6 @@
#if defined(__sun)
# include <sys/port.h>
# include <port.h>
-# ifdef PORT_SOURCE_FILE
-# define HAVE_PORTS_FS 1
-# endif
# define futimes(fd, tv) futimesat(fd, (void*)0, tv)
#endif /* __sun */
View
23 src/unix/sunos.c
@@ -39,15 +39,13 @@
#include <kstat.h>
#include <fcntl.h>
-#if HAVE_PORTS_FS
-# include <sys/port.h>
-# include <port.h>
-
-# define PORT_FIRED 0x69
-# define PORT_UNUSED 0x0
-# define PORT_LOADED 0x99
-# define PORT_DELETED -1
-#endif
+#include <sys/port.h>
+#include <port.h>
+
+#define PORT_FIRED 0x69
+#define PORT_UNUSED 0x0
+#define PORT_LOADED 0x99
+#define PORT_DELETED -1
#if (!defined(_LP64)) && (_FILE_OFFSET_BITS - 0 == 64)
#define PROCFS_FILE_OFFSET_BITS_HACK 1
@@ -272,7 +270,8 @@ void uv_loadavg(double avg[3]) {
}
-#if HAVE_PORTS_FS
+#if defined(PORT_SOURCE_FILE)
+
static void uv__fs_event_rearm(uv_fs_event_t *handle) {
if (handle->fd == -1)
return;
@@ -386,7 +385,7 @@ void uv__fs_event_close(uv_fs_event_t* handle) {
uv__handle_stop(handle);
}
-#else /* !HAVE_PORTS_FS */
+#else /* !defined(PORT_SOURCE_FILE) */
int uv_fs_event_init(uv_loop_t* loop,
uv_fs_event_t* handle,
@@ -402,7 +401,7 @@ void uv__fs_event_close(uv_fs_event_t* handle) {
UNREACHABLE();
}
-#endif /* HAVE_PORTS_FS */
+#endif /* defined(PORT_SOURCE_FILE) */
char** uv_setup_args(int argc, char** argv) {

0 comments on commit 69ab328

Please sign in to comment.
Something went wrong with that request. Please try again.