bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] 1(3) hurd+glibc: Support for file record locking


From: Samuel Thibault
Subject: Re: [PATCH] 1(3) hurd+glibc: Support for file record locking
Date: Sun, 3 Feb 2019 13:46:23 +0100
User-agent: NeoMutt/20170113 (1.7.2)

Hello,

Svante Signell, le dim. 03 févr. 2019 13:31:11 +0100, a ecrit:
> GNU/Linux and GNU/Hurd: (all OK)
> Terminal 1 and Terminal 2:
> ./test-flock foo r x
> ./test-flock foo w x
> ./test-flock foo r xn
> ./test-flock foo w xn

Ok. One remaining question is whether we want to let flock work even
without any R or W open mode.  I guess we can be conservative and say
"no", that won't be a problem for POSIX programs which don't have a way
to open a file without one of them.

In the end, instead of

> if ((openstat & O_RDONLY) && !(openstat & O_WRONLY)) openstat |= O_WRONLY;
> if (!(openstat & O_RDONLY) && (openstat & O_WRONLY)) openstat |= O_RDONLY;

We can simply use

if (openstat & (O_RDONLY|O_WRONLY|O_EXEC)) openstat |= O_RDONLY|O_WRONLY;

(no need to distinguish separate cases)

> I will add comments in the code when we agree of the above issue and re-submit
> the libdiskfs and libnetfs patches.

Thanks!

Samuel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]