This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Consodilate file open mode logic


On 05/24/2013 03:14 AM, OndÅej BÃlka wrote:
> As I fixed fopen, fdopen, fmemopen bugs it come as afterthought that one
> of causes is duplicating parsing logic. 
> 
> A better way could be add function say
> 
> int __fmode(char *mode)
> 
> which returns bitmask with flags described by mode.
> 
> Comments?
 
I like it, but we need a unit test or some kind of other
test to show __fmode() behaves as required by all the
code paths that use it.

Refactoring is something we haven't realy done in glibc
because without any test-drive approaches it was risky.

Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]