Changeset: 33c8421b4f77 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/33c8421b4f77
Modified Files:
common/stream/stdio_stream.c
Branch: Jul2021
Log Message:
Show useful error message if internal_log_bat runs out of disk space
Now:
client2: internal_log_bat: !ERROR: write failed: stream
/mnt/farm/demo/sql_logs/sql/log.4: write error: No space left on device
Used to be:
client2: internal_log_bat: !ERROR: write failed: no error
diffs (13 lines):
diff --git a/common/stream/stdio_stream.c b/common/stream/stdio_stream.c
--- a/common/stream/stdio_stream.c
+++ b/common/stream/stdio_stream.c
@@ -55,7 +55,8 @@ file_write(stream *restrict s, const voi
if (elmsize && cnt) {
size_t rc = fwrite(buf, elmsize, cnt, fp);
- if (!rc && ferror(fp)) {
+ if (rc != cnt) {
+ // only happens if fwrite encountered an error.
mnstr_set_error_errno(s, MNSTR_WRITE_ERROR, "write
error");
return -1;
}
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]