summaryrefslogtreecommitdiff
path: root/pflocal/socket.c
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-07-15 22:33:26 +0000
committerMiles Bader <miles@gnu.org>1995-07-15 22:33:26 +0000
commitd8f9ddbf411b05a1fa7cdd637b83822ebce59fea (patch)
treea3ff6b3f7b95161cf312509db0459ce1a7fe1862 /pflocal/socket.c
parent6e6d09aa6c7f9ee601022b4245004d2db72b8234 (diff)
Formerly socket.c.~9~
Diffstat (limited to 'pflocal/socket.c')
-rw-r--r--pflocal/socket.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/pflocal/socket.c b/pflocal/socket.c
index 2e694815..492f149f 100644
--- a/pflocal/socket.c
+++ b/pflocal/socket.c
@@ -195,11 +195,18 @@ S_socket_send (struct sock_user *user, struct addr *dest_addr, unsigned flags,
if (err)
return err;
+ if (user->sock->read_pipe->class != dest_sock->read_pipe->class)
+ /* Sending to a different type of socket! */
+ return EINVAL; /* ? XXX */
+
err = sock_get_addr (user->sock, &source_addr);
if (!err)
{
/* Grab the destination socket's read pipe directly, and stuff data
- into it. */
+ into it. This is not quite the usage sock_aquire_read_pipe was
+ intended for, but it will work, as the only inappropiate 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_aquire_read_pipe (dest, &pipe);
if (!err)
{