From 4e12c4327a6a1d525c30908efe70125f44abcb32 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Wed, 26 Nov 2008 19:05:35 +0000 Subject: [PATCH] Avoid useless assignment to errno and add scope operator for safety. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27713 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Server.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Server.cpp b/src/Server.cpp index 294943e360..d7a2e2514c 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -183,12 +183,11 @@ int LyXComm::startPipe(string const & file, bool write) if (filename.exists()) { if (!write) { // Let's see whether we have a stale pipe. - errno = 0; int fd = ::open(filename.toFilesystemEncoding().c_str(), O_WRONLY | O_NONBLOCK); if (fd >= 0) { // Another LyX instance is using it. - close(fd); + ::close(fd); } else if (errno == ENXIO) { // No process is reading from the other end. stalepipe = true;