aboutsummaryrefslogtreecommitdiff
path: root/libdiskfs/dir-lookup.c
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1996-10-10 21:13:37 +0000
committerThomas Bushnell <thomas@gnu.org>1996-10-10 21:13:37 +0000
commit3cabe8d87469422c549d61e7845cc044fe72c660 (patch)
tree96ee2f26536f1264bd6dbbfff95444137b69e6a8 /libdiskfs/dir-lookup.c
parentd20d69575f684bf4c355521006a6c9686340d5cf (diff)
downloadhurd-3cabe8d87469422c549d61e7845cc044fe72c660.tar.gz
hurd-3cabe8d87469422c549d61e7845cc044fe72c660.tar.bz2
hurd-3cabe8d87469422c549d61e7845cc044fe72c660.zip
*** empty log message ***
Diffstat (limited to 'libdiskfs/dir-lookup.c')
-rw-r--r--libdiskfs/dir-lookup.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/libdiskfs/dir-lookup.c b/libdiskfs/dir-lookup.c
index 36f2bceb..272b8bd8 100644
--- a/libdiskfs/dir-lookup.c
+++ b/libdiskfs/dir-lookup.c
@@ -397,16 +397,27 @@ diskfs_S_dir_lookup (struct protid *dircred,
if ((flags & O_NOATIME) && (diskfs_isowner (np, dircred) == EPERM))
flags &= ~O_NOATIME;
-
- flags &= ~OPENONLY_STATE_MODES;
- error = diskfs_create_protid (diskfs_make_peropen (np, flags,
+ error = diskfs_create_protid (diskfs_make_peropen (np,
+ (flags
+ & OPENONLY_STATE_MODES),
dircred->po->dotdotport),
dircred->uids, dircred->nuids,
dircred->gids, dircred->ngids,
&newpi);
+
if (! error)
{
+ if (flags & O_EXLOCK)
+ error = fshelp_acquire_lock (&np->userlock, &po->lock_status,
+ &np->lock, LOCK_EX);
+ else if (flags & O_SHLOCK)
+ error = fshelp_acquire_lock (&np->userlock, &po->lock_status,
+ &np->lock, LOCK_SH);
+ }
+
+ if (!error)
+ {
*returned_port = ports_get_right (newpi);
ports_port_deref (newpi);
}