summaryrefslogtreecommitdiff
path: root/pflocal
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2012-07-01 02:12:43 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2012-07-01 02:12:43 +0000
commit13ea39a34766fcbecd96ab94bcdf798b08e9bb60 (patch)
tree1e1463b03838a6f36868a4dafc7e652358a51857 /pflocal
parent1f8d504f631531c199d7c6154a0dc442d80ea4a7 (diff)
parent7e15f3d69a83a34ac62cbbee944a0bfbfa92724e (diff)
Merge branch 'master' into xkb
Conflicts: config.make.in configure.in
Diffstat (limited to 'pflocal')
-rw-r--r--pflocal/Makefile2
-rw-r--r--pflocal/io.c2
-rw-r--r--pflocal/pf.c4
-rw-r--r--pflocal/socket.c4
4 files changed, 7 insertions, 5 deletions
diff --git a/pflocal/Makefile b/pflocal/Makefile
index a7e664fa..7258e587 100644
--- a/pflocal/Makefile
+++ b/pflocal/Makefile
@@ -26,7 +26,7 @@ LCLHDRS = connq.h sock.h mig-decls.h mig-mutate.h sserver.h
MIGSTUBS = ioServer.o socketServer.o
OBJS = $(SRCS:.c=.o) $(MIGSTUBS)
-HURDLIBS = pipe trivfs fshelp threads ports ihash shouldbeinlibc
+HURDLIBS = pipe trivfs iohelp fshelp threads ports ihash shouldbeinlibc
MIGSFLAGS = -imacros $(srcdir)/mig-mutate.h
diff --git a/pflocal/io.c b/pflocal/io.c
index 74c2f970..36221a66 100644
--- a/pflocal/io.c
+++ b/pflocal/io.c
@@ -106,7 +106,7 @@ S_io_write (struct sock_user *user,
{
err = pipe_write (pipe, user->sock->flags & SOCK_NONBLOCK,
source_addr, data, data_len, amount);
- if (source_addr)
+ if (err && source_addr)
ports_port_deref (source_addr);
}
diff --git a/pflocal/pf.c b/pflocal/pf.c
index 852aabbb..55824d41 100644
--- a/pflocal/pf.c
+++ b/pflocal/pf.c
@@ -65,7 +65,7 @@ S_socket_create (mach_port_t pf,
case SOCK_SEQPACKET:
pipe_class = seqpack_pipe_class; break;
default:
- return ESOCKTNOSUPPORT;
+ return EPROTOTYPE;
}
err = sock_create (pipe_class, mode, &sock);
@@ -114,7 +114,7 @@ S_socket_fabricate_address (mach_port_t pf,
}
/* Implement socket_whatis_address as described in <hurd/socket.defs>.
- Since we cannot tell what our adress is, return an empty string as
+ Since we cannot tell what our address is, return an empty string as
the file name. This is primarily for the implementation of accept
and recvfrom. The functions getsockname and getpeername remain
unsupported for the local namespace. */
diff --git a/pflocal/socket.c b/pflocal/socket.c
index c5c4e1df..2684a723 100644
--- a/pflocal/socket.c
+++ b/pflocal/socket.c
@@ -37,6 +37,8 @@ S_socket_connect2 (struct sock_user *user1, struct sock_user *user2)
return EOPNOTSUPP;
err = sock_connect (user1->sock, user2->sock);
+ if (!err && user1->sock->pipe_class->flags & PIPE_CLASS_CONNECTIONLESS)
+ err = sock_connect (user2->sock, user1->sock);
/* Since USER2 isn't in the receiver position in the rpc, we get a send
right for it (although we only use the receive right with the same
@@ -309,7 +311,7 @@ S_socket_send (struct sock_user *user, struct addr *dest_addr, int flags,
if (dest_sock)
/* Grab the destination socket's read pipe directly, and stuff data
into it. This is not quite the usage sock_acquire_read_pipe was
- intended for, but it will work, as the only inappropiate errors
+ intended for, but it will work, as the only inappropriate errors
occur on a broken pipe, which shouldn't be possible with the sort of
sockets with which we can use socket_send... XXXX */
err = sock_acquire_read_pipe (dest_sock, &pipe);