mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-10 18:58:10 +00:00
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:
parent
9a67491a3f
commit
4e12c4327a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user