mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-03-30 11:11:05 -04:00
scanner: fail if there is an I/O error
If there has been an I/O error returning 0 is a bad idea. Signed-off-by: Demi Marie Obenour <demi@invisiblethingslab.com>
This commit is contained in:
parent
6c4a695045
commit
aa85e18dbf
1 changed files with 6 additions and 2 deletions
|
|
@ -2037,6 +2037,7 @@ int main(int argc, char *argv[])
|
||||||
bool strict = false;
|
bool strict = false;
|
||||||
bool fail = false;
|
bool fail = false;
|
||||||
int opt;
|
int opt;
|
||||||
|
int io_err;
|
||||||
enum {
|
enum {
|
||||||
CLIENT_HEADER,
|
CLIENT_HEADER,
|
||||||
SERVER_HEADER,
|
SERVER_HEADER,
|
||||||
|
|
@ -2205,7 +2206,10 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
free_protocol(&protocol);
|
free_protocol(&protocol);
|
||||||
fclose(input);
|
io_err = fflush(NULL) || ferror(stdout) || ferror(input);
|
||||||
|
if (io_err)
|
||||||
|
fprintf(stderr, "I/O error during processing\n");
|
||||||
|
|
||||||
return 0;
|
fclose(input);
|
||||||
|
return io_err;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue