Pārlūkot izejas kodu

libgis: report reason if unable to seek

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@73610 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 6 gadi atpakaļ
vecāks
revīzija
f6b0f3aad4
1 mainītis faili ar 4 papildinājumiem un 2 dzēšanām
  1. 4 2
      lib/gis/seek.c

+ 4 - 2
lib/gis/seek.c

@@ -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 @@ void G_fseek(FILE *fp, off_t offset, int whence)
 {
 #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     
 }