Re: [PATCH] umount: always use umount2 syscall with specified flags

2015-10-17 Thread Xabier Oneca -- xOneca
Hello, 2015-10-13 17:02 GMT+02:00 Denys Vlasenko : > On Tue, Oct 13, 2015 at 3:09 PM, Jody Bruchon wrote: >> 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 >>

Re: [PATCH] umount: always use umount2 syscall with specified flags

2015-10-13 Thread walter harms
maybe that is a clever solution, but it causes the code to be unreadable. (read:no chance to understand before unterstanding this typedef and its consequences) just my 2 cents, re, wh Am 05.10.2015 19:04, schrieb Denys Vlasenko: > On Sat, Oct 3, 2015 at 12:58 PM, Xabier Oneca -- xOneca >

Re: [PATCH] umount: always use umount2 syscall with specified flags

2015-10-13 Thread Jody Bruchon
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. This is arguably a prime example of a poor

Re: [PATCH] umount: always use umount2 syscall with specified flags

2015-10-13 Thread Denys Vlasenko
On Tue, Oct 13, 2015 at 1:00 PM, Jody Bruchon 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

Re: [PATCH] umount: always use umount2 syscall with specified flags

2015-10-13 Thread Jody Bruchon
On 2015-10-13 08:42, Denys Vlasenko wrote: > On Tue, Oct 13, 2015 at 1:00 PM, Jody Bruchon 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

Re: [PATCH] umount: always use umount2 syscall with specified flags

2015-10-13 Thread Jody Bruchon
On October 13, 2015 11:02:45 AM EST, Denys Vlasenko wrote: is obvious you did not bother reading the code before coming up >with criticism. I apologize and withdraw my statements. I will say that a comment explaining why that typedef exists would still be beneficial.

Re: [PATCH] umount: always use umount2 syscall with specified flags

2015-10-13 Thread Denys Vlasenko
I committed several changes which adopt kernel-style BUILD_BUG_ON: #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) Need some analogue for declaration-level check. BUILD_BUG_ON would not work here: typedef struct svstatus_t { uint64_t time_be64 PACKED;

Re: [PATCH] umount: always use umount2 syscall with specified flags

2015-10-13 Thread Denys Vlasenko
On Tue, Oct 13, 2015 at 3:09 PM, Jody Bruchon wrote: > On 2015-10-13 08:42, Denys Vlasenko wrote: >> On Tue, Oct 13, 2015 at 1:00 PM, Jody Bruchon >> wrote: >>> I agree. There is no good reason for doing this at all. It looks like >>> someone has

Re: [PATCH] umount: always use umount2 syscall with specified flags

2015-10-05 Thread Sam Liddicott
Some discussion on better encapsulations of the technique here: http://stackoverflow.com/questions/174356/ways-to-assert-expressions-at-build-time-in-c Sam On Sat, Oct 3, 2015 at 11:58 AM, Xabier Oneca -- xOneca wrote: > Hello, > > Excuse my ignorance, but what does this

Re: [PATCH] umount: always use umount2 syscall with specified flags

2015-10-05 Thread Denys Vlasenko
On Sat, Oct 3, 2015 at 12:58 PM, Xabier Oneca -- xOneca wrote: > Hello, > > Excuse my ignorance, but what does this typedef do? > > -- > { > typedef char bug[ > (OPT_FORCE != MNT_FORCE || OPT_LAZY != MNT_DETACH) ? -1 : 1 > ]; >

Re: [PATCH] umount: always use umount2 syscall with specified flags

2015-10-03 Thread Xabier Oneca -- xOneca
Hello, Excuse my ignorance, but what does this typedef do? -- { typedef char bug[ (OPT_FORCE != MNT_FORCE || OPT_LAZY != MNT_DETACH) ? -1 : 1 ]; } -- My understanding is that this snippet catches when those two constants are

Re: [PATCH] umount: always use umount2 syscall with specified flags

2015-10-01 Thread Denys Vlasenko
Applied, thanks! ___ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox