if (ctx->problem_log_fn)
free(ctx->problem_log_fn);
- if (ctx->problem_logf)
+ if (ctx->problem_logf) {
+ fputs("</problem_log>\n", ctx->problem_logf);
fclose(ctx->problem_logf);
-
+ }
ext2fs_free_mem(&ctx);
}
struct problem_context *pctx)
{
if (ptr->flags & PR_HEADER) {
- fprintf(f, "<header code=\"0x%06x\">\n", code);
+ fprintf(f, "<header code=\"0x%06x\"/>\n", code);
return;
}
fprintf(f, "<problem code=\"0x%06x\" answer=\"%d\"", code, answer);
if (ptr->count == ptr->max_count + 1) {
if (ctx->problem_logf)
fprintf(ctx->problem_logf,
- "<suppressed code=\"0x%06x\">\n", code);
+ "<suppressed code=\"0x%06x\"/>\n",
+ code);
printf("...problem 0x%06x suppressed\n",
ptr->e2p_code);
fflush(stdout);
fputs("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
ctx->problem_logf);
+ fprintf(ctx->problem_logf, "<problem_log time=\"%lu\">\n",
+ ctx->now);
fprintf(ctx->problem_logf, "<invocation prog=\"%s\"",
argv[0]);
for (i = 1; i < argc; i++)
- fprintf(ctx->problem_logf, " arg=\"%s\"", argv[i]);
- fputs(">\n", ctx->problem_logf);
+ fprintf(ctx->problem_logf, " arg%d=\"%s\"", i, argv[i]);
+ fputs("/>\n", ctx->problem_logf);
}
init_resource_track(&ctx->global_rtrack, NULL);
}
if (sb->s_volume_name[0]) {
memset(buf, 0, sizeof(buf));
- strncpy(buf, sb->s_volume_name,
- sizeof(sb->s_volume_name));
+ strncpy(buf, sb->s_volume_name, sizeof(buf));
fprintf(ctx->problem_logf, " label=\"%s\"", buf);
}
- fputs(">\n", ctx->problem_logf);
+ fputs("/>\n", ctx->problem_logf);
}
ehandler_init(fs->io);