On Thu, Sep 27, 2012 at 1:51 PM, Julien Rioux <jri...@physics.utoronto.ca> wrote: > On 27/09/2012 7:17 AM, Scott Kostyshak wrote: >> >> - ::write(pipefd, cmd.c_str(), cmd.length()); >> + if (::write(pipefd, cmd.c_str(), cmd.length()) < 0) >> + LYXERR0("Cannot write to pipe!"); > > > You're space-indenting in a tab-indented file here. >
Good catch. I thought I had git set up to detect these white space errors but I guess not. Attached is the updated patch. Thanks, Scott
From 35dcd7f6fb88a47bda9342e53d528cb521f34505 Mon Sep 17 00:00:00 2001 From: Scott Kostyshak <skost...@lyx.org> Date: Thu, 27 Sep 2012 06:29:27 -0400 Subject: [PATCH] Use a return value to report an unsuccessful write Use a return value in LyXComm::loadFilesInOtherInstance to give an error for a failed write to pipe. --- src/Server.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Server.cpp b/src/Server.cpp index 7ec096e..1e673e6 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -1015,7 +1015,8 @@ bool LyXComm::loadFilesInOtherInstance() break; string const cmd = "LYXCMD:pipe:file-open:" + fname.absFileName() + '\n'; - ::write(pipefd, cmd.c_str(), cmd.length()); + if (::write(pipefd, cmd.c_str(), cmd.length()) < 0) + LYXERR0("Cannot write to pipe!"); ::close(pipefd); ++loaded_files; it = theFilesToLoad().erase(it); -- 1.7.9.5