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

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jun 29 02:59:45 PDT 2014


Author: glynn
Date: 2014-06-29 02:59:45 -0700 (Sun, 29 Jun 2014)
New Revision: 61048

Modified:
   grass/trunk/lib/raster/close.c
Log:
Describe underlying error if rename() fails


Modified: grass/trunk/lib/raster/close.c
===================================================================
--- grass/trunk/lib/raster/close.c	2014-06-29 04:18:50 UTC (rev 61047)
+++ grass/trunk/lib/raster/close.c	2014-06-29 09:59:45 UTC (rev 61048)
@@ -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;
 	    }
 	    /* if rename() was successful what is left to remove() ? */
@@ -436,8 +437,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;
 	}
 	/* if rename() was successful what is left to remove() ? */



More information about the grass-commit mailing list