]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(_nss_files_get,ENTNAME_r): Initialize position when file was opened here.
authorUlrich Drepper <drepper@redhat.com>
Wed, 24 Jun 1998 17:25:57 +0000 (17:25 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 24 Jun 1998 17:25:57 +0000 (17:25 +0000)
nss/nss_files/files-XXX.c

index b36a8b97157767920fe9ec91c6fe39d3e3baefba..c1e716d3d0066280cccb34cacf32b9d22920aaa4 100644 (file)
@@ -223,7 +223,16 @@ CONCAT(_nss_files_get,ENTNAME_r) (struct STRUCTURE *result,
 
   /* Be prepared that the set*ent function was not called before.  */
   if (stream == NULL)
-    status = internal_setent (0);
+    {
+      status = internal_setent (0);
+
+      if (status == NSS_STATUS_SUCCESS && fgetpos (stream, &position) < 0)
+       {
+         fclose (stream);
+         stream = NULL;
+         status = NSS_STATUS_UNAVAIL;
+       }
+    }
 
   if (status == NSS_STATUS_SUCCESS)
     {