const char *traceprintstr= getenv("ADNS_TEST_FUZZRAW_TRACEPRINT");
if (traceprintstr) {
traceprint= atoi(traceprintstr);
- traceout= fdopen(2,"w"); if (!traceout) Tfailed("fdopen for traceout");
+ int tracefd= dup(2);
+ if (tracefd<0) Tfailed("dup for tracefd");
+ traceout= fdopen(tracefd,"w");
+ if (!traceout) Tfailed("fdopen for traceout");
}
}
}
extern void Tshutdown(void) {
+ if (!Tinputfile) return;
int c= fgetc(Tinputfile);
if (c!=EOF) Pformat("unwanted additional syscall reply data");
if (ferror(Tinputfile)) Tfailed("read test log input (at end)");
#ifdef FUZZRAW_SYNC
hm_fr_syscall_ident($'`1)
static char sync_got[sizeof(sync_expect)];
- Psync(sync_expect, sync_got, sizeof(sync_got), "sync lost: exp=$1");
+ Psync(sync_expect, sync_got, sizeof(sync_got), "sync lost: program did $1");
#endif
')