}
void Tensurerecordfile(void) {
- const char *fdstr;
int fd;
int chars;
unsigned long sec, usec;
if (Tinputfile) return;
Tinputfile= stdin;
- fdstr= getenv("ADNS_TEST_IN_FD");
- if (fdstr) {
- fd= atoi(fdstr);
+ fd = Ttestinputfd();
+ if (fd >= 0) {
Tinputfile= fdopen(fd,"r"); if (!Tinputfile) Tfailed("fdopen ADNS_TEST_IN_FD");
}
setvbuf(Tinputfile,0,_IONBF,0);
if (te->n) return te->v;
r= strtoul(stuff+2,&ep,10);
if (*ep) Psyntax("errno value not recognised, not numeric");
+ if (r==0 || r>255) Psyntax("numeric errno out of range 1..255");
return r;
}