diff options
author | Miles Bader <miles@gnu.org> | 1995-07-31 16:52:26 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1995-07-31 16:52:26 +0000 |
commit | 9cda8e6760736cbddc466ae6125aa2a4e666e147 (patch) | |
tree | 6cef8b43e4f128f7f443684c43a1e2be235cf18d /libdiskfs | |
parent | b142756a7e66997efe6fccdec2e84725404a0298 (diff) |
(diskfs_S_ifsock_getsockaddr): Try to restart the PF_LOCAL server if it dies.
Diffstat (limited to 'libdiskfs')
-rw-r--r-- | libdiskfs/ifsock.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libdiskfs/ifsock.c b/libdiskfs/ifsock.c index 4b34586d..b7df10cf 100644 --- a/libdiskfs/ifsock.c +++ b/libdiskfs/ifsock.c @@ -31,6 +31,7 @@ diskfs_S_ifsock_getsockaddr (struct protid *cred, { error_t err; struct node *np; + unsigned restart_tries = 0; /* Make sure this is a socket */ if (!cred) @@ -89,6 +90,16 @@ diskfs_S_ifsock_getsockaddr (struct protid *cred, /* Create an address for the node */ err = socket_fabricate_address (server, AF_LOCAL, &sockaddr); + if ((err == MACH_SEND_INVALID_DEST || err == MIG_SERVER_DIED) + && restart_tries++ == 0) + /* The PF_LOCAL server died; try to restart it. */ + { + spin_lock (&pflocalserverlock); + if (pflocalserver == server) + pflocalserver = MACH_PORT_NULL; + spin_unlock (&pflocalserverlock); + goto retry; + } if (err) { mutex_unlock (&np->lock); |