summaryrefslogtreecommitdiff
path: root/libiohelp
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1993-12-03 03:22:41 +0000
committerMichael I. Bushnell <mib@gnu.org>1993-12-03 03:22:41 +0000
commit3534efe77cdb565b49df4d10f45a5f1b8f905e71 (patch)
tree69c9974300f910f7c652d049dd5b6463edd7ad96 /libiohelp
parent130e42dc78f67aa7b769ea88a3207d00e9918757 (diff)
Formerly verify_user_conch.c.~2~
Diffstat (limited to 'libiohelp')
-rw-r--r--libiohelp/verify_user_conch.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libiohelp/verify_user_conch.c b/libiohelp/verify_user_conch.c
index 180d132f..b7a1e506 100644
--- a/libiohelp/verify_user_conch.c
+++ b/libiohelp/verify_user_conch.c
@@ -15,6 +15,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+#include <libioserver.h>
+#include <errno.h>
+
error_t
verify_user_conch (struct conch *c, void *user)
{
@@ -24,10 +27,12 @@ verify_user_conch (struct conch *c, void *user)
return EPERM;
user_sh = c->holder_shared_page;
spin_lock (&user_sh->lock);
- if (user_sh != USER_HAS_CONCH && user_sh != USER_RELEASE_CONCH)
+ if (user_sh->conch_status != USER_HAS_CONCH
+ && user_sh->conch_status != USER_RELEASE_CONCH)
{
spin_unlock (&user_sh->lock);
return EPERM;
}
spin_unlock (&user_sh->lock);
+ return 0;
}