[GRASS-SVN] r73610 - grass/trunk/lib/gis
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Oct 26 00:36:50 PDT 2018
Author: mmetz
Date: 2018-10-26 00:36:50 -0700 (Fri, 26 Oct 2018)
New Revision: 73610
Modified:
grass/trunk/lib/gis/seek.c
Log:
libgis: report reason if unable to seek
Modified: grass/trunk/lib/gis/seek.c
===================================================================
--- grass/trunk/lib/gis/seek.c 2018-10-24 20:05:32 UTC (rev 73609)
+++ grass/trunk/lib/gis/seek.c 2018-10-26 07:36:50 UTC (rev 73610)
@@ -12,6 +12,8 @@
*/
#include <stdio.h>
+#include <errno.h>
+#include <string.h>
#include <sys/types.h>
#include <grass/gis.h>
#include <grass/glocale.h>
@@ -49,12 +51,12 @@
{
#ifdef HAVE_FSEEKO
if (fseeko(fp, offset, whence) != 0)
- G_fatal_error(_("Unable to seek"));
+ G_fatal_error(_("Unable to seek: %s"), strerror(errno));
#else
long loff = (long) offset;
if ((off_t) loff != offset)
G_fatal_error(_("Seek offset out of range"));
if (fseek(fp, loff, whence) != 0)
- G_fatal_error(_("Unable to seek"));
+ G_fatal_error(_("Unable to seek: %s"), strerror(errno));
#endif
}
More information about the grass-commit
mailing list