Skip to content

Commit

Permalink
Picking first file from /proc/1 for eof testing
Browse files Browse the repository at this point in the history
RT #128831
  • Loading branch information
cuonglm committed Sep 23, 2016
1 parent 692343c commit 528d162
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions S16-io/eof.t
Expand Up @@ -20,15 +20,19 @@ my $tmpfile = "eof-test-" ~ nonce();
}

# RT #127370
my $procfile = '/proc/1/comm';
{
if $*KERNEL.name eq 'linux' {
my $fh = open $procfile or die qq/Failed to open "$procfile": $!/;
;
# RT #128831
my $files = gather {
for '/proc/1'.IO.dir() -> $file {
take $file if $file.f && $file.r;
}
}
my $fh = $files[0].open;
$fh.slurp-rest;

ok $fh.eof, '/proc file EOF was reached';
close $fh or die qq/Failed to close "$procfile": $!/;
$fh.close;
}
else {
skip "Don't test reading /proc file if not in Linux", 1;
Expand Down

0 comments on commit 528d162

Please sign in to comment.