mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-03-29 07:58:19 -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
80701ca876
1 changed files with 6 additions and 2 deletions
|
|
@ -2062,6 +2062,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,
|
||||||
|
|
@ -2230,7 +2231,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