1
0
Fork 0

Fix incorrect write() return code handling

This commit is contained in:
James Turner 2020-03-20 22:24:44 +00:00
parent 6849311d49
commit 5f0c10d94d

View file

@ -515,7 +515,7 @@ bool fgInitHome()
} }
int err = write(fd, buf, len); 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 SG_LOG(SG_GENERAL, SG_ALERT, "failed to write to lock file:" << pidPath
<< "\n\tdue to:" << simgear::strutils::error_string(errno)); << "\n\tdue to:" << simgear::strutils::error_string(errno));
return false; return false;