Index: contrib/gcclibs/libcpp/files.c
===================================================================
--- contrib/gcclibs/libcpp/files.c	(revision 263376)
+++ contrib/gcclibs/libcpp/files.c	(working copy)
@@ -545,7 +545,7 @@
 static bool
 read_file_guts (cpp_reader *pfile, _cpp_file *file)
 {
-  ssize_t size, total, count;
+  ssize_t size, offset, total, count;
   uchar *buf;
   bool regular;
 
@@ -573,12 +573,21 @@
 	}
 
       size = file->st.st_size;
+
+      if ((offset = (ssize_t)lseek(file->fd, (off_t)0, SEEK_CUR)) < 0)
+	{
+	  cpp_error (pfile, CPP_DL_ERROR, "%s has no current position", file->path);
+	  return false;
+	}
     }
   else
-    /* 8 kilobytes is a sensible starting size.  It ought to be bigger
-       than the kernel pipe buffer, and it's definitely bigger than
-       the majority of C source files.  */
-    size = 8 * 1024;
+    {
+      /* 8 kilobytes is a sensible starting size.  It ought to be bigger
+	 than the kernel pipe buffer, and it's definitely bigger than
+	 the majority of C source files.  */
+      size = 8 * 1024;
+      offset = 0;
+    }
 
   buf = XNEWVEC (uchar, size + 1);
   total = 0;
@@ -586,7 +595,7 @@
     {
       total += count;
 
-      if (total == size)
+      if (offset + total == size)
 	{
 	  if (regular)
 	    break;
@@ -601,7 +610,7 @@
       return false;
     }
 
-  if (regular && total != size && STAT_SIZE_RELIABLE (file->st))
+  if (regular && offset + total != size && STAT_SIZE_RELIABLE (file->st))
     cpp_error (pfile, CPP_DL_WARNING,
 	       "%s is shorter than expected", file->path);
 
