MCPcopy Create free account
hub / github.com/dmtcp/dmtcp / writeToLog

Method writeToLog

jalib/jassert.cpp:313–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311}
312
313void
314jassert_internal::JAssert::writeToLog(const char *str)
315{
316 // Lazily open log file.
317 if (theLogFileFd == -1) {
318 if (write(jalib::logFd(), str, 0) != -1) {
319 theLogFileFd = jalib::logFd();
320 } else if (logFilePath[0] != '\0') {
321 open_log_file();
322 }
323 }
324
325 if (theLogFileFd != -1) {
326 int rv = jwrite(theLogFileFd, str);
327
328 if (rv < 0 && theLogFileFd == EBADF) {
329 if (errConsoleFd != -1) {
330 jwrite(errConsoleFd, "JASSERT: failed to write to log file.\n");
331 }
332 theLogFileFd = -1;
333 }
334 }
335}

Callers

nothing calls this directly

Calls 1

jwriteFunction · 0.85

Tested by

no test coverage detected