summaryrefslogtreecommitdiff
path: root/trans/ifsock.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2001-02-26 04:16:01 +0000
committerRoland McGrath <roland@gnu.org>2001-02-26 04:16:01 +0000
commit43dc903ebfb710ea2e7844859d9c722b81e71799 (patch)
treeaad36af3ade5b690f0fc720f833620025cc57a11 /trans/ifsock.c
parented7c279a06c09c49c5b9d41af284a162f94838cb (diff)
2001-02-25 Roland McGrath <roland@frob.com>
* symlink.c: Include <string.h> for decls of built-ins. * firmlink.c: Include <stdlib.h> for exit decl. * ifsock.c: Likewise. * null.c: Likewise. * magic.c: Likewise. * fifo.c: Likewise. * hello.c: Likewise. * hello-mt.c: Likewise.
Diffstat (limited to 'trans/ifsock.c')
-rw-r--r--trans/ifsock.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/trans/ifsock.c b/trans/ifsock.c
index 15fb7df3..319db6b3 100644
--- a/trans/ifsock.c
+++ b/trans/ifsock.c
@@ -1,5 +1,5 @@
/* Server for S_IFSOCK nodes
- Copyright (C) 1994, 1995 Free Software Foundation
+ Copyright (C) 1994, 1995, 2001 Free Software Foundation
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -23,6 +23,7 @@
#include <hurd/socket.h>
#include <hurd/fsys.h>
#include <stdio.h>
+#include <stdlib.h>
#include <error.h>
#include <fcntl.h>
@@ -72,7 +73,7 @@ main (int argc, char **argv)
task_get_bootstrap_port (mach_task_self (), &bootstrap);
if (bootstrap == MACH_PORT_NULL)
error(1, 0, "Must be started as a translator");
-
+
/* Reply to our parent */
err = trivfs_startup (bootstrap, 0, control_class, port_bucket,
node_class, port_bucket, NULL);
@@ -115,18 +116,18 @@ error_t
S_ifsock_getsockaddr (file_t sockfile,
mach_port_t *address)
{
- struct trivfs_protid *cred = ports_lookup_port (port_bucket, sockfile,
+ struct trivfs_protid *cred = ports_lookup_port (port_bucket, sockfile,
node_class);
int perms;
error_t err;
-
+
if (!cred)
return EOPNOTSUPP;
-
+
err = file_check_access (cred->realnode, &perms);
if (!err && !(perms & O_READ))
err = EACCES;
-
+
if (!err)
*address = address_port;
ports_port_deref (cred);