Nicolas Pitre wrote:
> On Wed, 27 Jan 2010, Spencer Oliver wrote:
> 
>> Cygwin would fail to reopen a previously written file if the mode is
>> not given.
> 
> What do you mean?
> 

If we use a open on the target the first time cygwin host opens a new 
file all is well. If we reset micro and try to reopen an existing file 
cygwin will fail without the permission set to 0644 !!.

Not sure it is a problem if you use fopen, just open.

>> Simplified converting the open flags and made sure the win32 O_BINARY
>> bit is set.
> 
> ACK.
> 
>> Added define for systems that do not support O_BINARY.
> 
> ACK.
> 
>> Signed-off-by: Spencer Oliver <ntfr...@users.sourceforge.net>
> 
> You fail to mention this though:
> 
>>                              if (strcmp((char *)fn, ":tt") == 0) {
>> -                                    if ((mode & 3) == 0)
>> -                                            result = dup(0);
>> +                                    if (m < 4)
>> +                                            result = STDIN_FILENO;
>>                                      else
>> -                                            result = dup(1);
>> +                                            result = STDOUT_FILENO;
> 
> Why are you removing the dup()?
> 
> The remote application does open stdin/stdout explicitly, and may well 
> close them explicitly as well.  It is therefore a bad idea to pass our 
> own stdin/stdout straight to the remote application.
> 

Point taken, will revert that bit.
using dup also will help to redirect at a later stage aswell.

Cheers
Spen
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to