bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: more 5.3.0 issues on cygwin


From: Paul Eggert
Subject: Re: more 5.3.0 issues on cygwin
Date: Mon, 17 Jan 2005 14:55:36 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Eric Blake <address@hidden> writes:

> --- src/install.c     26 Nov 2004 07:39:32 -0000      1.172
> +++ src/install.c     17 Jan 2005 13:09:07 -0000
> @@ -566,6 +566,20 @@ strip (const char *path)
>        error (EXIT_FAILURE, errno, _("fork system call failed"));
>        break;
>      case 0:                  /* Child. */
> +#ifdef __CYGWIN__
> +      {
> +     /* Unfortunately we have to check for .exe here since strip doesn't. */
> +     char *p;
> +     if ((p = strchr (path, '\0') - 4) <= path
> +         || strcasecmp (p, ".exe") != 0)
> +       {
> +         p = alloca (strlen (path) + 5);
> +         strcat (strcpy (p, path), ".exe");
> +         if (!access (p, F_OK))
> +           path = p;
> +       }
> +      }
> +#endif
>        execlp ("strip", "strip", path, NULL);
>        error (EXIT_FAILURE, errno, _("cannot run strip"));
>        break;

This #ifdef looks a bit extreme.  Can't you just fix "strip" instead?
Or surround it by a shell wrapper that does the right thing?



> Index: src/od.c
> ===================================================================
> RCS file: /cvsroot/coreutils/coreutils/src/od.c,v
> retrieving revision 1.152
> diff -u -p -r1.152 od.c
> --- src/od.c  28 Sep 2004 01:09:03 -0000      1.152
> +++ src/od.c  17 Jan 2005 13:09:07 -0000
> @@ -70,6 +70,12 @@ typedef unsigned long long int ulonglong
>  typedef unsigned long int ulonglong_t;
>  #endif
>  
> +#ifdef O_BINARY
> +# define OPENMODE "rb"
> +#else
> +# define OPENMODE "r"
> +#endif
> +
>  enum size_spec
>    {
>      NO_SIZE,
> @@ -906,7 +912,7 @@ open_next_file (void)
>       }
>        else
>       {
> -       in_stream = fopen (input_filename, "r");
> +       in_stream = fopen (input_filename, OPENMODE);
>         if (in_stream == NULL)
>           {
>             error (0, errno, "%s", input_filename);


It'd be easier to simply use "rb" rather than "r", and avoid all the
ifdefery.  But I don't get why this change only is needed.  What's
special about "od"?  Don't you have dozens of similar problems
elsewhere?  E.g., with "cp", "dd", "mv", "shred", "split", "sum".




reply via email to

[Prev in Thread] Current Thread [Next in Thread]