]> git.lyx.org Git - features.git/commitdiff
Squash MSVC warning "local variable 'fd' used without having
authorAngus Leeming <leeming@lyx.org>
Tue, 15 Feb 2005 11:04:40 +0000 (11:04 +0000)
committerAngus Leeming <leeming@lyx.org>
Tue, 15 Feb 2005 11:04:40 +0000 (11:04 +0000)
been initialized".

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9631 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/lyxserver.C

index eb246b261a0a10720f17447a25c39582b8906323..b26aa048f0ed70e797ad6ea895e5151ac646889a 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-15  Angus Leeming  <leeming@lyx.org>
+
+       * lyxserver.C (startPipe): squash MSVC warning "local variable
+       'fd' used without having been initialized".
+
 2005-02-14  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
 
        * BufferView_pimpl.C: revert accidental commit.
index 63cd5b4553ed968e3a864f257ff65d019cc4fa94..a6213f9deefe2fce95e8559d0ff8c1d7d8daef65 100644 (file)
@@ -147,8 +147,6 @@ void LyXComm::closeConnection()
 
 int LyXComm::startPipe(string const & filename, bool write)
 {
-       int fd;
-
 #ifdef __EMX__
        HPIPE os2fd;
        APIRET rc;
@@ -181,7 +179,7 @@ int LyXComm::startPipe(string const & filename, bool write)
        };
        // Imported handles can be used both with OS/2 APIs and emx
        // library functions.
-       fd = _imphandle(os2fd);
+       int const fd = _imphandle(os2fd);
 #else
        if (::access(filename.c_str(), F_OK) == 0) {
                lyxerr << "LyXComm: Pipe " << filename << " already exists.\n"
@@ -196,7 +194,8 @@ int LyXComm::startPipe(string const & filename, bool write)
                       << strerror(errno) << endl;
                return -1;
        };
-       fd = ::open(filename.c_str(), write ? (O_RDWR) : (O_RDONLY|O_NONBLOCK));
+       int const fd = ::open(filename.c_str(),
+                             write ? (O_RDWR) : (O_RDONLY|O_NONBLOCK));
 #endif
 
        if (fd < 0) {