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

Bug#841386: libc6: perror() changes orientation of non-oriented stderr when it is redirected



control: forwarded -1 https://sourceware.org/bugzilla/show_bug.cgi?id=20677
control: severity -1 normal

On 2016-10-20 12:50, Igor Liferenko wrote:
> Package: libc6
> Version: 2.24-3
> Severity: important
> Tags: patch
> 
> Dear Maintainer,
> 
> This bug can be seen by compiling the following program and then running
> 
>     $ ./a.out 2>/dev/null
> 
> The output is
> 
>     initial fwide: 0
>     fwide: -1
> 
> The attached patch fixes this, so that the output becomes
> 
>     initial fwide: 0
>     fwide: 0
> 
> 
> #include <stdio.h>
> #include <wchar.h>
> #include <errno.h>
> int main(void)
> {
>   printf("initial fwide: %d\n", fwide(stderr, 0));
>   errno = EINVAL;
>   perror(""); /* note, that prior to this call stderr was not oriented */
>   printf("fwide: %d\n", fwide(stderr, 0));
>   return 0;
> }
> 
> Cheers,
> Igor
> 
> P.S. I posted a <a href="https://sourceware.org/bugzilla/show_bug.cgi?id=20677";>bugreport to upstream</a>
> I can only guess why this 100% *small* bug has not been fixed ...

This bug is only open upstream for 10 days, and you got comments about
it 3 days ago. Please be a bit patient.

Anyway thanks for reporting the bug upstream, I have marked the bug as
forwarded, so we'll get warned when it the bug has been fixed upstream.

Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net


Reply to: