diff options
author | Miles Bader <miles@gnu.org> | 1995-09-06 15:55:33 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1995-09-06 15:55:33 +0000 |
commit | 17ceb8b2c478974e2c6a74a32000e9f59077983f (patch) | |
tree | d16a5dd87abf72e0bbdf9265ee4129bd81e2c317 | |
parent | 34394c68889736a46bd9d4f00955229df48bf88b (diff) |
(S_io_read, S_io_readable): Don't return EPIPE on EOF.
-rw-r--r-- | pflocal/io.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/pflocal/io.c b/pflocal/io.c index b37ce7e2..cdbdc3b1 100644 --- a/pflocal/io.c +++ b/pflocal/io.c @@ -53,7 +53,10 @@ S_io_read (struct sock_user *user, err = sock_acquire_read_pipe (user->sock, &pipe); if (err == EPIPE) /* EOF */ - *data_len = 0; + { + err = 0; + *data_len = 0; + } else if (!err) { err = @@ -138,7 +141,10 @@ S_io_readable (struct sock_user *user, mach_msg_type_number_t *amount) err = sock_acquire_read_pipe (user->sock, &pipe); if (err == EPIPE) /* EOF */ - *amount = 0; + { + err = 0; + *amount = 0; + } else if (!err) { *amount = pipe_readable (user->sock->read_pipe, 1); @@ -166,13 +172,9 @@ S_io_duplicate (struct sock_user *user, if (!user) return EOPNOTSUPP; -debug (user, "duping, sock: %p", user->sock); err = sock_create_port (user->sock, new_port); if (! err) *new_port_type = MACH_MSG_TYPE_MAKE_SEND; -{unsigned refs; - mach_port_get_refs (mach_task_self (), user->pi.port_right, MACH_PORT_RIGHT_SEND, &refs); - debug (user, "send rights: %d", refs);} return err; } |