chiark / gitweb /
Portability: Fix assumption about read() and write() on connecting sockets
[adns] / regress / update-extra-select
CommitLineData
777763cb
IJ
1#!/usr/bin/perl -wp
2use strict;
3
4our ($fd, $timeadj);
5
6BEGIN {
7 $fd = -1;
8}
9
10if (m/^ connect fd=(\d+) /) {
11 $fd=$1; next;
12}
13
14if (m/^ read fd=$fd buflen=1$/) {
15 die if $timeadj;
16 print
17 " select max=".($fd+1)." rfds=null wfds=[$fd]".
18 " efds=null to=0.000000\n".
19 " select=1 rfds=null wfds=[$fd] efds=null\n".
20 "+0.000001\n";
21 $timeadj = -0.000001;
22}
23
24if (m/^ \+([0-9.]+)$/ && $timeadj) {
25 $_ = sprintf " +%.6f\n", $1 + $timeadj;
26 $timeadj = 0;
27}