Welcome! Log In Create A New Profile

Advanced

[PATCH 0 of 1] Tests: unbreak reading new stderr data after eof ...

Sergey Kandaurov
May 26, 2023 07:30AM
Simple test to reproduce.

#!/usr/bin/perl

use warnings;
use strict;

open STDERR, '>', 'stderr' or die "Can't reopen STDERR: $!";
open my $stderr, '<', 'stderr' or die "Can't open stderr file: $!";

if (fork() == 0) {
print STDERR "SEE-THIS";
sleep 1;
print STDERR "AND-THAT";
exit 0;
}

use Data::Dumper;

select undef, undef, undef, 0.1 until -s 'stderr' > 0;
my $n = -s 'stderr';
print Dumper <$stderr>;
print "size = $n pos = ", tell $stderr, "\n";

select undef, undef, undef, 0.1 until -s 'stderr' > $n;
$n = -s 'stderr';
print Dumper <$stderr>;
print "size = $n pos = ", tell $stderr, "\n";

###############################################################################

vanilla perl$ perl test_readline.t
$VAR1 = 'SEE-THIS';
size = 8 pos = 8
$VAR1 = 'AND-THAT';
size = 16 pos = 16

80c1f1e45e8e$ perl test_readline.t
$VAR1 = 'SEE-THIS';
size = 8 pos = 8
size = 16 pos = 8
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH 0 of 1] Tests: unbreak reading new stderr data after eof ...

Sergey Kandaurov 310 May 26, 2023 07:30AM

[PATCH 1 of 1] Tests: unbreak reading new stderr data after eof

Sergey Kandaurov 81 May 26, 2023 07:30AM

Re: [PATCH 1 of 1] Tests: unbreak reading new stderr data after eof

Maxim Dounin 92 May 26, 2023 12:48PM

Re: [PATCH 1 of 1] Tests: unbreak reading new stderr data after eof

Sergey Kandaurov 110 May 29, 2023 09:32AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 303
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready