changeset 5838:b1500f1ec617

Check return value of lseek.
author Marcus Crestani <marcus@crestani.de>
date Sat, 13 Dec 2014 14:02:55 +0100
parents 09b5be18ba0e
children d139eb1fead8
files src/ChangeLog src/dumper.c
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sat Dec 13 13:58:16 2014 +0100
+++ b/src/ChangeLog	Sat Dec 13 14:02:55 2014 +0100
@@ -1,3 +1,7 @@
+2014-12-13  Marcus Crestani  <crestani@xemacs.org>
+
+	* dumper.c (pdump_file_get): Check return value of lseek.
+
 2014-12-13  Marcus Crestani  <crestani@xemacs.org>
 
 	* dumper.c (pdump): fdopen returns NULL when it fails.
--- a/src/dumper.c	Sat Dec 13 13:58:16 2014 +0100
+++ b/src/dumper.c	Sat Dec 13 14:02:55 2014 +0100
@@ -2553,7 +2553,11 @@
       return 0;
     }
 
-  lseek (fd, 0, SEEK_SET);
+  if (lseek (fd, 0, SEEK_SET) == -1)
+    {
+      retry_close (fd);
+      return 0;
+    }
 
 #ifdef HAVE_MMAP
 /* Unix 98 requires that sys/mman.h define MAP_FAILED,