Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@sourceware.cygnus.com Delivered-To: mailing list cygwin@sourceware.cygnus.com Message-ID: <38897EC1.32A5E56C@vinschen.de> Date: Sat, 22 Jan 2000 10:56:17 +0100 From: Corinna Vinschen X-Mailer: Mozilla 4.7 [en] (WinNT; I) X-Accept-Language: de,en MIME-Version: 1.0 To: Steve Kelem , bug-gnu-utils@prep.ai.mit.edu CC: cygwin@sourceware.cygnus.com Subject: Re: problem compiling sharutils-4.2.1 under Cygwin 1.0 References: <388904B0.1E9524FE@adaptivesilicon.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Steve Kelem wrote: > I'm trying to build sharutils-4.2.1 under Cygwin 1.0 on WinNT 4.0 SP6 on > a Pentium III 550. > > It appears to build and compile ok, but fails the first test. I'm sure you have textmode mounts. Try using binmode mounts or better change the sources of sharutils to support the "b" flag of f(re)open if compiled with cygwin. It's simple. Example from sharutils-4.2, uudecode/uuencode: --- uudecode.c.orig Sat Jan 22 10:42:30 2000 +++ uudecode.c Sat Jan 22 10:41:41 2000 @@ -339,8 +339,13 @@ decode (inname, forced_outname) /* Create output file and set mode. */ +#ifdef __CYGWIN__ +#define OPENMODE "wb" +#else +#define OPENMODE "w" +#endif if (strcmp (outname, "/dev/stdout") != 0 && strcmp (outname, "-") != 0 - && (freopen (outname, "w", stdout) == NULL + && (freopen (outname, OPENMODE, stdout) == NULL #if HAVE_FCHMOD || fchmod (fileno (stdout), mode & (S_IRWXU | S_IRWXG | S_IRWXO)) #else --- uuencode.c.orig Sat Jan 22 10:42:45 2000 +++ uuencode.c Sat Jan 22 10:43:24 2000 @@ -270,7 +270,13 @@ main (argc, argv) /* Optional first argument is input file. */ - if (!freopen (argv[optind], "r", stdin) || fstat (fileno (stdin), &sb)) +#ifdef __CYGWIN__ +#define OPENMODE "rb" +#else +#define OPENMODE "r" +#endif + if (!freopen (argv[optind], OPENMODE, stdin) + || fstat (fileno (stdin), &sb)) error (EXIT_FAILURE, errno, "%s", argv[optind]); mode = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); optind++; -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe@sourceware.cygnus.com