if (CORD_str(x,0,"9abcdefghijx") != CORD_NOT_FOUND)
ABORT("CORD_str failed 3");
if (CORD_str(x,0,"9>") != CORD_NOT_FOUND) ABORT("CORD_str failed 4");
+ /* Note: f1a, f1b, f2 handles are closed lazily by CORD library. */
+ /* TODO: Propose and use CORD_fclose. */
+ *(CORD volatile *)&w = CORD_EMPTY;
+ *(CORD volatile *)&z = CORD_EMPTY;
+ GC_gcollect();
+ GC_invoke_finalizers();
+ /* Of course, this does not guarantee the files are closed. */
if (remove(FNAME1) != 0) {
/* On some systems, e.g. OS2, this may fail if f1 is still open. */
- if ((fclose(f1a) == EOF) & (fclose(f1b) == EOF))
- ABORT("fclose(f1) failed");
- if (remove(FNAME1) != 0) ABORT("remove 1 failed");
+ /* But we cannot call fclose as it might lead to double close. */
+ fprintf(stderr, "WARNING: remove(FNAME1) failed\n");
}
if (remove(FNAME2) != 0) {
- if (fclose(f2) == EOF) ABORT("fclose(f2) failed");
- if (remove(FNAME2) != 0) ABORT("remove 2 failed");
+ fprintf(stderr, "WARNING: remove(FNAME2) failed\n");
}
}