qfile-agent.c: exit on EPIPE after gui progress write
The qvm-{copy,move}-to-vm.{gnome,kde} cancel buttons didn't actually cancel, because qfile-agent ignored EPIPE and - via qfile_pack_init() - SIGPIPE. So it never noticed when the local PROGRESS_TYPE=gui reader had shut down.
This commit is contained in:
parent
f037ffa852
commit
8da7c7af60
@ -33,15 +33,16 @@ void do_notify_progress(long long total, int flag)
|
|||||||
ignore = write(2, msg, strlen(msg));
|
ignore = write(2, msg, strlen(msg));
|
||||||
if (flag == PROGRESS_FLAG_DONE)
|
if (flag == PROGRESS_FLAG_DONE)
|
||||||
ignore = write(2, "\n", 1);
|
ignore = write(2, "\n", 1);
|
||||||
|
if (ignore < 0) {
|
||||||
|
/* silence gcc warning */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!strcmp(progress_type_env, "gui") && saved_stdout_env) {
|
if (!strcmp(progress_type_env, "gui") && saved_stdout_env) {
|
||||||
char msg[256];
|
char msg[256];
|
||||||
snprintf(msg, sizeof(msg), "%lld\n", total);
|
snprintf(msg, sizeof(msg), "%lld\n", total);
|
||||||
ignore = write(strtoul(saved_stdout_env, NULL, 0), msg,
|
if (write(strtoul(saved_stdout_env, NULL, 0), msg, strlen(msg)) == -1
|
||||||
strlen(msg));
|
&& errno == EPIPE)
|
||||||
}
|
exit(32);
|
||||||
if (ignore < 0) {
|
|
||||||
/* silence gcc warning */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user