mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
Merge branch 'scanner-io-error' into 'main'
scanner: fail if there is an I/O error See merge request wayland/wayland!410
This commit is contained in:
commit
15514cf0c2
1 changed files with 6 additions and 2 deletions
|
|
@ -2045,6 +2045,7 @@ int main(int argc, char *argv[])
|
|||
bool strict = false;
|
||||
bool fail = false;
|
||||
int opt;
|
||||
int io_err;
|
||||
enum {
|
||||
CLIENT_HEADER,
|
||||
SERVER_HEADER,
|
||||
|
|
@ -2213,7 +2214,10 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
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