summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
cbf1fae)
When sysread encounters an error, it returns undef, which yields a warning
when compared against 0. This fixes the problem.
# Read and print out pipe data.
my ($len) = length ($buf);
# Read and print out pipe data.
my ($len) = length ($buf);
- waitpid ($pid, 0), last
- if sysread ($in, $buf, 4096, $len) <= 0;
+ my ($n_read) = sysread ($in, $buf, 4096, $len);
+ waitpid ($pid, 0), last if !defined ($n_read) || $n_read <= 0;
print substr ($buf, $len);
# Remove full lines from $buf and scan them for keywords.
print substr ($buf, $len);
# Remove full lines from $buf and scan them for keywords.