SHA256
1
0
forked from pool/tigervnc
tigervnc/u_tigervnc-Ignore-epipe-on-write.patch
Stefan Dirsch 37c2fbf427 Accepting request 1147784 from home:jtorres:branches:X11:XOrg
- Cleanup specfile
  * Use the same format for all the patches.
  * Use autosetup to apply all the patches with -p1.
  * Clean number of sources.

OBS-URL: https://build.opensuse.org/request/show/1147784
OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/tigervnc?expand=0&rev=254
2024-02-20 16:03:58 +00:00

27 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: tigervnc-1.13.1/common/rdr/FdOutStream.cxx
===================================================================
--- tigervnc-1.13.1.orig/common/rdr/FdOutStream.cxx
+++ tigervnc-1.13.1/common/rdr/FdOutStream.cxx
@@ -128,8 +128,12 @@ size_t FdOutStream::writeFd(const void*
#endif
} while (n < 0 && (errno == EINTR));
- 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);