summaryrefslogtreecommitdiff
path: root/deps/uv/src/unix/sunos.c
diff options
context:
space:
mode:
Diffstat (limited to 'deps/uv/src/unix/sunos.c')
-rw-r--r--deps/uv/src/unix/sunos.c57
1 files changed, 28 insertions, 29 deletions
diff --git a/deps/uv/src/unix/sunos.c b/deps/uv/src/unix/sunos.c
index a43f7f1b1c..2dc02ae457 100644
--- a/deps/uv/src/unix/sunos.c
+++ b/deps/uv/src/unix/sunos.c
@@ -99,6 +99,18 @@ void uv__platform_loop_delete(uv_loop_t* loop) {
}
+int uv__io_fork(uv_loop_t* loop) {
+#if defined(PORT_SOURCE_FILE)
+ if (loop->fs_fd != -1) {
+ /* stop the watcher before we blow away its fileno */
+ uv__io_stop(loop, &loop->fs_event_watcher, POLLIN);
+ }
+#endif
+ uv__platform_loop_delete(loop);
+ return uv__platform_loop_init(loop);
+}
+
+
void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) {
struct port_event* events;
uintptr_t i;
@@ -469,8 +481,10 @@ int uv_fs_event_start(uv_fs_event_t* handle,
memset(&handle->fo, 0, sizeof handle->fo);
handle->fo.fo_name = handle->path;
err = uv__fs_event_rearm(handle);
- if (err != 0)
+ if (err != 0) {
+ uv_fs_event_stop(handle);
return err;
+ }
if (first_run) {
uv__io_init(&handle->loop->fs_event_watcher, uv__fs_event_read, portfd);
@@ -531,25 +545,6 @@ void uv__fs_event_close(uv_fs_event_t* handle) {
#endif /* defined(PORT_SOURCE_FILE) */
-char** uv_setup_args(int argc, char** argv) {
- return argv;
-}
-
-
-int uv_set_process_title(const char* title) {
- return 0;
-}
-
-
-int uv_get_process_title(char* buffer, size_t size) {
- if (buffer == NULL || size == 0)
- return -EINVAL;
-
- buffer[0] = '\0';
- return 0;
-}
-
-
int uv_resident_set_memory(size_t* rss) {
psinfo_t psinfo;
int err;
@@ -746,6 +741,17 @@ static int uv__set_phys_addr(uv_interface_address_t* address,
return 0;
}
+
+static int uv__ifaddr_exclude(struct ifaddrs *ent) {
+ if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)))
+ return 1;
+ if (ent->ifa_addr == NULL)
+ return 1;
+ if (ent->ifa_addr->sa_family == PF_PACKET)
+ return 1;
+ return 0;
+}
+
int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
uv_interface_address_t* address;
struct ifaddrs* addrs;
@@ -759,12 +765,8 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
/* Count the number of interfaces */
for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
- if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)) ||
- (ent->ifa_addr == NULL) ||
- (ent->ifa_addr->sa_family == PF_PACKET)) {
+ if (uv__ifaddr_exclude(ent))
continue;
- }
-
(*count)++;
}
@@ -777,10 +779,7 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
address = *addresses;
for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
- if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING)))
- continue;
-
- if (ent->ifa_addr == NULL)
+ if (uv__ifaddr_exclude(ent))
continue;
address->name = uv__strdup(ent->ifa_name);