Changeset: b5b4a7c8eae9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b5b4a7c8eae9
Modified Files:
        gdk/gdk_storage.c
Branch: Jun2023
Log Message:

A single error message if read fails is enough.


diffs (22 lines):

diff --git a/gdk/gdk_storage.c b/gdk/gdk_storage.c
--- a/gdk/gdk_storage.c
+++ b/gdk/gdk_storage.c
@@ -550,7 +550,7 @@ GDKload(int farmid, const char *nme, con
                                for (n_expected = (ssize_t) size; n_expected > 
0; n_expected -= n) {
                                        n = read(fd, dst, (unsigned) MIN(1 << 
30, n_expected));
                                        if (n < 0)
-                                               GDKsyserror("GDKload: cannot 
read: name=%s, ext=%s, %zu bytes missing\n", nme, ext ? ext : "", (size_t) 
n_expected);
+                                               GDKsyserror("GDKload: cannot 
read: name=%s, ext=%s, expected %zu, %zd bytes missing\n", nme, ext ? ext : "", 
size, n_expected);
 #ifndef __COVERITY__
                                        /* Coverity doesn't seem to
                                         * recognize that we're just
@@ -567,7 +567,8 @@ GDKload(int farmid, const char *nme, con
                                        /* we couldn't read all, error
                                         * already generated */
                                        GDKfree(ret);
-                                       GDKerror("short read from heap %s%s%s, 
expected %zu, missing %zd\n", nme, ext ? "." : "", ext ? ext : "", size, 
n_expected);
+                                       if (n >= 0) /* don't report error twice 
 */
+                                               GDKerror("short read from heap 
%s%s%s, expected %zu, missing %zd\n", nme, ext ? "." : "", ext ? ext : "", 
size, n_expected);
                                        ret = NULL;
                                }
 #ifndef NDEBUG
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to