瀏覽代碼

CIODevice: printf() thought it was calling ::write() but it was write()

There's some confusion between the write syscall and CIODevice::write()
here. The internal write() returns a boolean, and has already whined
in case the syscall failed, so we don't need to do that again.
Andreas Kling 6 年之前
父節點
當前提交
385e9268f4
共有 1 個文件被更改,包括 1 次插入3 次删除
  1. 1 3
      Libraries/LibCore/CIODevice.cpp

+ 1 - 3
Libraries/LibCore/CIODevice.cpp

@@ -249,9 +249,7 @@ int CIODevice::printf(const char* format, ...)
     va_start(ap, format);
     // FIXME: We're not propagating write() failures to client here!
     int ret = printf_internal([this](char*&, char ch) {
-        int rc = write((const u8*)&ch, 1);
-        if (rc < 0)
-            dbgprintf("CIODevice::printf: write: %s\n", strerror(errno));
+        write((const u8*)&ch, 1);
     },
         nullptr, format, ap);
     va_end(ap);