[prev in list] [next in list] [prev in thread] [next in thread] 

List:       monetdb-checkins
Subject:    MonetDB: Jul2021 - Show useful error message if internal_log_bat...
From:       Joeri_van_Ruth <commits+joeri.van.ruth=monetdbsolutions.com () mon
Date:       2022-06-29 15:05:11
Message-ID: hg.33c8421b4f77.1656515111.1755896868472722261 () dev ! monetdb ! org
[Download RAW message or body]

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 -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-leave@monetdb.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic