[uClibc]fdopen() problem

Manuel Novoa III mnovoa3 at bellsouth.net
Mon Mar 19 22:22:09 UTC 2001


On Mon, 19 Mar 2001, Magick wrote:
> I hit something simular with libz. It does a fdopen of stdout, which could
> be opened read+write. And i gave it a good night sleep ;-p
> And this is what i came up with:
> 
> #define O_ACCMODE          0003
> #define O_RDONLY             00
> #define O_WRONLY             01
> #define O_RDWR               02
> 
> (cur_mode ^ open_mode)
> 
> (2 ^ 0) & 3 == 2
> (2 ^ 1) & 3 == 3
> The bits differ, but a legal mode. Your using a fd
> opened RDWR for reading OR writing, I don't think thats a problem.
> 
> I think it should be changed to:
> if ((cur_mode == -1) || (cur_mode == O_RDWR) && ((cur_mode ^ open_mode) &
> O_ACCMODE))

Thanks, but it was fixed over the weekend.

Manuel





More information about the uClibc mailing list