tigervnc/u_tigervnc-ignore-epipe-on-write.patch
Michal Srb bac2b6338f Accepting request 234861 from home:michalsrb:branches:X11:XOrg
- u_tigervnc-ignore-epipe-on-write.patch
  * Do not display error message because of EPIPE on write.
    (bnc#864676)

OBS-URL: https://build.opensuse.org/request/show/234861
OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/tigervnc?expand=0&rev=28
2014-05-20 14:05:40 +00:00

26 lines
1.0 KiB
Diff

Author: Michal Srb <msrb@suse.com>
Subject: Ignore EPIPE on write.
Patch-Mainline: To be upstreamed
References: bnc#864676
If the VNC server closes connection after our last read and before this write, we will report error message about EPIPE.
This situation is no error, however, we should quit normally same as when we find out that connection was closed during read.
Index: common/rdr/FdOutStream.cxx
===================================================================
--- common/rdr/FdOutStream.cxx (revision 5178)
+++ common/rdr/FdOutStream.cxx (working copy)
@@ -225,7 +225,12 @@
// network connections. Should in fact never ever happen...
} while (n < 0 && (errno == EWOULDBLOCK));
- if (n < 0) throw SystemException("write",errno);
+ if (n < 0) {
+ if(errno == EPIPE)
+ n = length; // Ignore EPIPE and fake successfull write, it doesn't matter that we are writing to closed socket, we will find out once we try to read from it.
+ else
+ throw SystemException("write", errno);
+ }
gettimeofday(&lastWrite, NULL);