more logging
authorJeroen van der Heijden <jeroen@transceptor.technology>
Wed, 26 Feb 2020 13:36:39 +0000 (14:36 +0100)
committerJeroen van der Heijden <jeroen@transceptor.technology>
Wed, 26 Feb 2020 13:36:39 +0000 (14:36 +0100)
src/siri/db/shard.c

index c0669f9605c313140a31d6128aca303912468d06..61ffb5351718061b4e6c8b9688b62452f6ee6c2b 100644 (file)
@@ -492,8 +492,10 @@ size_t siridb_shard_write_points(
     {
         if (siri_fopen(siri.fh, shard->fp, shard->fn, "r+"))
         {
+            char buf[1024];
+            log_critical("Cannot open file '%s' (%s)",
+                    shard->fn, strerror_r(errno, buf, 1024));
             ERR_FILE
-            log_critical("Cannot open file '%s'", shard->fn);
             return 0;
         }
     }
@@ -599,8 +601,10 @@ size_t siridb_shard_write_points(
 
     if (rc != 1 || fflush(fp))
     {
+        char buf[1024];
+        log_critical("Cannot write points to file '%s' (%s)",
+                shard->fn, strerror_r(errno, buf, 1024));
         ERR_FILE
-        log_critical("Cannot write points to file '%s'", shard->fn);
         return 0;
     }