bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: [bug-gnu-utils] sharutils-4.14 compilation issue


From: Eric Blake
Subject: Re: [bug-gnu-utils] sharutils-4.14 compilation issue
Date: Fri, 25 Apr 2014 12:43:27 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 04/25/2014 08:36 AM, Eric Blake wrote:

> Here's the patch I had to apply to package sharutils for cygwin:
> 
> --- origsrc/sharutils-4.14/src/scribble.c     2013-05-19 08:49:05.000000000
> -0600
> +++ src/sharutils-4.14/src/scribble.c 2014-04-16 09:08:54.492563800 -0600
> @@ -1,4 +1,4 @@
> -
> +#include <config.h>
>  #include <stdio.h>

While this patch is required for ALL platforms,

>  #include <stdlib.h>
>  #include "scribble.h"
> --- origsrc/sharutils-4.14/src/shar.c 2013-10-12 16:18:28.000000000 -0600
> +++ src/sharutils-4.14/src/shar.c     2014-04-16 09:03:17.826856400 -0600
> @@ -1107,7 +1107,7 @@ emit_char_ct_validation (
>    sprintf (command, cct_cmd, quoted_name);
> 
>    {
> -    FILE * pfp = popen (command, "r");
> +    FILE * pfp = popen (command, "rb");

you'll probably want this one to be gated by conditional compilation.
While "rb" is required for fopen() to force binary mode, it is a
non-POSIX extension supported by Cygwin but not all other platforms when
dealing with popen().  Something like this is sufficient (all known
platforms where O_BINARY is non-zero support the extension):

popen (command, O_BINARY ? "rb" : "r")

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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