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
This commit is contained in:
Enrico Forestieri 2008-11-26 19:05:35 +00:00
parent 9a67491a3f
commit 4e12c4327a

View File

@ -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;