summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1993-12-03 02:42:54 +0000
committerMichael I. Bushnell <mib@gnu.org>1993-12-03 02:42:54 +0000
commitab2788b3f02a77c01fe3cda826748de36986e7e2 (patch)
tree8cb874f75379ea87cfc31176d9ab302af26e6298
parentd133ba7d3c50768f2591d6ecd95003c264860ba7 (diff)
Formerly handle_io_get_conch.c.~2~
-rw-r--r--libiohelp/handle_io_get_conch.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/libiohelp/handle_io_get_conch.c b/libiohelp/handle_io_get_conch.c
index 249e9e46..6ca09098 100644
--- a/libiohelp/handle_io_get_conch.c
+++ b/libiohelp/handle_io_get_conch.c
@@ -19,12 +19,10 @@
#include <libioserver.h>
error_t
-handle_io_get_conch (struct conch *c, void *user, struct shared *user_sh)
+handle_io_get_conch (struct conch *c, void *user, struct shared_io *user_sh)
{
- error_t error;
+ error_t error = 0;
- mutex_lock (&c->lock);
-
if (c->holder == user)
{
if (user_sh->conch_status != USER_HAS_NOT_CONCH)
@@ -39,18 +37,18 @@ handle_io_get_conch (struct conch *c, void *user, struct shared *user_sh)
}
else
{
- error = _libioserver_internal_get_conch (c);
+ error = get_conch (c);
if (!error)
{
c->holder = user;
c->holder_shared_page = user_sh;
- user_sh->conch_status == USER_HAS_NOT_CONCH
+ if (user_sh->conch_status == USER_HAS_NOT_CONCH)
user_sh->accessed = user_sh->written = 0;
user_sh->conch_status = USER_HAS_CONCH;
put_shared_data (user);
}
}
- mutex_unlock (&c->lock);
+ return error;
}