summaryrefslogtreecommitdiff
path: root/pflocal
diff options
context:
space:
mode:
Diffstat (limited to 'pflocal')
-rw-r--r--pflocal/io.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pflocal/io.c b/pflocal/io.c
index 2a6b104c..4c79ec9f 100644
--- a/pflocal/io.c
+++ b/pflocal/io.c
@@ -324,7 +324,7 @@ S_io_stat (struct sock_user *user, struct stat *st)
st->st_fstype = FSTYPE_SOCKET;
st->st_mode = sock->mode;
st->st_fsid = getpid ();
- st->st_ino = sock->id;
+
/* As we try to be clever with large transfers, ask for them. */
st->st_blksize = vm_page_size * 16;
st->st_uid = sock->uid;
@@ -332,6 +332,11 @@ S_io_stat (struct sock_user *user, struct stat *st)
pthread_mutex_lock (&sock->lock); /* Make sure the pipes don't go away... */
+ if (sock->id == MACH_PORT_NULL)
+ mach_port_allocate (mach_task_self (), MACH_PORT_RIGHT_RECEIVE,
+ &sock->id);
+ st->st_ino = sock->id;
+
rpipe = sock->read_pipe;
wpipe = sock->write_pipe;