[PATCH] umount: always use umount2 syscall with specified flags
Jody Bruchon
jody at jodybruchon.com
Tue Oct 13 13:09:11 UTC 2015
On 2015-10-13 08:42, Denys Vlasenko wrote:
> On Tue, Oct 13, 2015 at 1:00 PM, Jody Bruchon <jody at jodybruchon.com>
wrote:
>> I agree. There is no good reason for doing this at all. It looks
like someone has intentionally obfuscated the code. If it's for throwing
an error on invalid configurations, other constructs exist that are much
more clear and are better supported.
>
> What construct do you propose?
This makes it sound like the whole OPT_FORCE/OPT_LAZY thing is unnecessary:
// MNT_FORCE and MNT_DETACH (from linux/fs.h) must match
// OPT_FORCE and OPT_LAZY.
If OPT_FORCE and OPT_LAZY must be the same as MNT_FORCE and MNT_DETACH
respectively, and we're including the system header where those values
are defined, why not use the header's names directly and thereby
eliminate the perverted typedef? Does it have to do with elimination of
options in the build system (i.e. does OPT_* cause items in
OPTION_STRING to be modified during building?)
Ignoring that observation, I would propose that #ifdef comparison(s) and
an #error where they mismatch would be much clearer than using a
conditionally invalid typedef that is not intended to be functional C code.
More information about the busybox
mailing list