This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: problem compiling sharutils-4.2.1 under Cygwin 1.0
- To: Steve Kelem <kelem at adaptivesilicon dot com>, bug-gnu-utils at prep dot ai dot mit dot edu
- Subject: Re: problem compiling sharutils-4.2.1 under Cygwin 1.0
- From: Corinna Vinschen <corinna at vinschen dot de>
- Date: Sat, 22 Jan 2000 10:56:17 +0100
- CC: cygwin at sourceware dot cygnus dot com
- References: <388904B0.1E9524FE@adaptivesilicon.com>
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