[GRASS-SVN] r61115 - grass/branches/releasebranch_7_0/lib/raster

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jul 2 04:08:04 PDT 2014


Author: martinl
Date: 2014-07-02 04:08:04 -0700 (Wed, 02 Jul 2014)
New Revision: 61115

Modified:
   grass/branches/releasebranch_7_0/lib/raster/close.c
Log:
glynn: Describe underlying error if rename() fails
       (merge r61048 from trunk)


Modified: grass/branches/releasebranch_7_0/lib/raster/close.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/raster/close.c	2014-07-02 10:02:41 UTC (rev 61114)
+++ grass/branches/releasebranch_7_0/lib/raster/close.c	2014-07-02 11:08:04 UTC (rev 61115)
@@ -22,6 +22,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <signal.h>
+#include <errno.h>
 
 #include <grass/gis.h>
 #include <grass/raster.h>
@@ -370,8 +371,8 @@
 	if (fcb->null_cur_row > 0) {
 	    /* if temporary NULL file exists, write it into cell_misc/name/null */
 	    if (rename(fcb->null_temp_name, path)) {
-		G_warning(_("Unable to rename null file '%s' to '%s'"),
-			  fcb->null_temp_name, path);
+		G_warning(_("Unable to rename null file '%s' to '%s': %s"),
+			  fcb->null_temp_name, path, strerror(errno));
 		stat = -1;
 	    }
 	    else {
@@ -435,8 +436,8 @@
 	G_file_name(path, CELL_DIR, fcb->name, fcb->mapset);
 	remove(path);
 	if (rename(fcb->temp_name, path)) {
-	    G_warning(_("Unable to rename cell file '%s' to '%s'"),
-		      fcb->temp_name, path);
+	    G_warning(_("Unable to rename cell file '%s' to '%s': %s"),
+		      fcb->temp_name, path, strerror(errno));
 	    stat = -1;
 	}
 	else {



More information about the grass-commit mailing list