This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos 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]

mk_romfs and binary mode for cygwin


I was wondering if the following line in
~/packages/fs/rom/current/support/mk_romfs.c
(around line 706)

 if ( (fd = open( av[2], O_WRONLY|O_CREAT|O_TRUNC, 0666 )) < 0 ) {

should be

 if ( (fd = open( av[2], O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0666 )) < 0
) {

If the file system is mounted in binary mode, this should have no
effect.

If you are running this program in under Cygwin and if the file system
is mounted in "text" mode,
then  the os will try to map \n into \r.  So one only sees a problem is
the file system is mounted in
"text" mode as opposed to "binary" mode.

However, if the system is mounted in binary mode, then C code written
under Windows does not
compile correctly, or more specifically, the cpp may not interpret
multi-lines correctly.

Comments?


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