From 316fd871634d7fda6e6cf08ec5a4cb5f1d6d0760 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Mon, 13 Nov 1995 21:51:06 +0000 Subject: (diskfs_S_file_lock_stat): Lock around reads to make sure they are mutually consistent. --- libdiskfs/file-lock-stat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libdiskfs') diff --git a/libdiskfs/file-lock-stat.c b/libdiskfs/file-lock-stat.c index ce291b76..75341617 100644 --- a/libdiskfs/file-lock-stat.c +++ b/libdiskfs/file-lock-stat.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1994 Free Software Foundation + Copyright (C) 1994, 1995 Free Software Foundation This file is part of the GNU Hurd. @@ -30,7 +30,9 @@ diskfs_S_file_lock_stat (struct protid *cred, if (!cred) return EOPNOTSUPP; + mutex_lock (&cred->po->np->lock); *mystatus = cred->po->lock_status; *otherstatus = cred->po->np->userlock.type; + mutex_unlock (&cred->po->np->lock); return 0; } -- cgit v1.2.3