[PATCH]: Port of openssh-2.1.0p3 to Cygwin environment

Corinna Vinschen corinna at vinschen.de
Mon Jun 12 01:54:24 EST 2000


Damien Miller wrote:
> > Porting to Cygwin has two major goals:
> >
> > - Care for all file access to differ `text mode' (files may have
> >   \n or \r\n line endings) from `binary mode' (files are always
> >   read as they are like in U*X).
> 
> This is the main problem with integrating the patch - it touched
> just about every open and fopen in the source. This make it more
> difficult to stay synched with the OpenBSD CVS tree (i.e lots more
> manual patching).
> 
> Is there any way to decrease the volume of these changes or isolate
> them to a one-off #define?

What do you think of something like

#ifdef __CYGWIN__
#define FOPEN_READ_TEXT "rt"
#define FOPEN_READ_BINARY "rb"
#else
#define FOPEN_READ_TEXT "r"
#define FOPEN_READ_BINARY "r"
#endif

and use FOPEN_READ_* throughout.  That still touches every single
fopen but it reduces the number of lines.

Corinna



> 
> I will give the diff a try over the weekend on our poor NT machine :)
> 
> Regards,
> Damien Miller
> 
> --
> | "Bombay is 250ms from New York in the new world order" - Alan Cox
> | Damien Miller - http://www.mindrot.org/
> | Email: djm at mindrot.org (home) -or- djm at ibs.com.au (work)

-- 
Corinna Vinschen
Cygwin Developer
Cygnus Solutions, a Red Hat company





More information about the openssh-unix-dev mailing list