[GRASS-SVN] r64899 - grass/trunk/lib/raster

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Mar 24 06:01:31 PDT 2015


Author: neteler
Date: 2015-03-24 06:01:31 -0700 (Tue, 24 Mar 2015)
New Revision: 64899

Modified:
   grass/trunk/lib/raster/put_row.c
Log:
libraster: use strerror(errno)

Modified: grass/trunk/lib/raster/put_row.c
===================================================================
--- grass/trunk/lib/raster/put_row.c	2015-03-24 09:23:17 UTC (rev 64898)
+++ grass/trunk/lib/raster/put_row.c	2015-03-24 13:01:31 UTC (rev 64899)
@@ -21,6 +21,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 #include <fcntl.h>
+#include <errno.h>
 
 #include <grass/config.h>
 #include <grass/raster.h>
@@ -117,8 +118,8 @@
     ssize_t nwrite = fcb->nbytes * n;
 
     if (write(fcb->data_fd, buf, nwrite) != nwrite)
-	G_fatal_error(_("Error writing uncompressed FP data for row %d of <%s>"),
-		      row, fcb->name);
+	G_fatal_error(_("Error writing uncompressed FP data for row %d of <%s>: %s"),
+		      row, fcb->name, strerror(errno));
 }
 
 static void write_data_compressed(int fd, int row, unsigned char *buf, int n)
@@ -127,8 +128,8 @@
     int nwrite = fcb->nbytes * n;
 
     if (G_zlib_write(fcb->data_fd, buf, nwrite) < 0)
-	G_fatal_error(_("Error writing compressed FP data for row %d of <%s>"),
-		      row, fcb->name);
+	G_fatal_error(_("Error writing compressed FP data for row %d of <%s>: %s"),
+		      row, fcb->name, strerror(errno));
 }
 
 static void set_file_pointer(int fd, int row)



More information about the grass-commit mailing list