mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
scanner: only abort() if there is a bug
abort() is for internal errors that indicate bugs, or for catastrophic failures such as out-of-memory. It is not for I/O errors or bad XML files. Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
This commit is contained in:
parent
efa648056a
commit
0c532fa783
1 changed files with 2 additions and 2 deletions
|
|
@ -129,7 +129,7 @@ is_dtd_valid(FILE *input, const char *filename)
|
|||
doc = xmlCtxtReadFd(ctx, fd, filename, NULL, 0);
|
||||
if (!doc) {
|
||||
fprintf(stderr, "Failed to read XML\n");
|
||||
abort();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
rc = xmlValidateDtd(dtdctx, doc, dtd);
|
||||
|
|
@ -141,7 +141,7 @@ is_dtd_valid(FILE *input, const char *filename)
|
|||
|
||||
if (lseek(fd, 0, SEEK_SET) != 0) {
|
||||
fprintf(stderr, "Failed to reset fd, output would be garbage.\n");
|
||||
abort();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif
|
||||
return rc;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue