[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] pipe, pipe2: don't corrupt fd on error
From: |
Bruno Haible |
Subject: |
Re: [PATCH] pipe, pipe2: don't corrupt fd on error |
Date: |
Thu, 30 Jun 2011 00:55:19 +0200 |
User-agent: |
KMail/1.9.9 |
Hi Eric,
> --- a/lib/pipe2.c
> +++ b/lib/pipe2.c
> @@ -40,6 +40,11 @@
> int
> pipe2 (int fd[2], int flags)
> {
> + /* Mingw _pipe() corrupts fd on failure; also, if we succeed at
> + creating the pipe but later fail at changing fcntl, we want
> + to leave fd unchanged: http://austingroupbugs.net/view.php?id=467 */
> + int tmp[2] = { fd[0], fd[1] };
> +
> #if HAVE_PIPE2
> # undef pipe2
> /* Try the system call first, if it exists. (We may be running with a
> glibc
>
This gives a compilation error with 'cc' on IRIX 6.5:
cc -O -DHAVE_CONFIG_H -I. -I.. -DGNULIB_STRICT_CHECKING=1 -c pipe2.c
cc-1028 cc: ERROR File = pipe2.c, Line = 46
The expression used must have a constant value.
int tmp[2] = { fd[0], fd[1] };
^
cc-1028 cc: ERROR File = pipe2.c, Line = 46
The expression used must have a constant value.
int tmp[2] = { fd[0], fd[1] };
^
2 errors detected in the compilation of "pipe2.c".
*** Error code 2 (bu21)
Bruno
--
In memoriam José Olaya <http://es.wikipedia.org/wiki/José_Olaya>