Skip to contentSkip to conversation

util/log: Fix rust_fwrite() to return bytes written

PATCH New CMoments 1 participant 1 message Aug 19

lore
Share & tools
lore

CMoments

author
#0 lore raw

PATCH 1/1 util/log: Fix rust_fwrite() to return bytes written

---
 util/log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
util/log.c +1 -1
index 7cffbc1bf89..0a8800f8d2c 100644
@@ -593,6 +593,6 @@ ssize_t rust_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
      * portable access to errno. :(
      */
     int ret = fwrite(ptr, size, nmemb, stream);
-    return ret < 0 ? -errno : 0;
+    return ret < 0 ? -errno : (ssize_t)(ret * size);
 }
 #endif
Signature · 3 lines
Signed-off-by: CMoments <[email protected]>
Cc: [email protected]
2.34.1