From 5f0c10d94d26cb5a5e7fcab19940ba2e0ff85883 Mon Sep 17 00:00:00 2001 From: James Turner Date: Fri, 20 Mar 2020 22:24:44 +0000 Subject: [PATCH] Fix incorrect write() return code handling --- src/Main/fg_init.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index f01234535..a1b3460bc 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -515,7 +515,7 @@ bool fgInitHome() } int err = write(fd, buf, len); - if (err != 0) { + if (err < 0) { SG_LOG(SG_GENERAL, SG_ALERT, "failed to write to lock file:" << pidPath << "\n\tdue to:" << simgear::strutils::error_string(errno)); return false;