EOF and writing the placeholder length field. Otherwise we can run
into an apparent bug in the Solaris 10 stdio library which causes the
next no-op fseek after the fwrite to fail with EINVAL.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22367
dc483132-0cff-0310-8789-
dd5450dbe970
return errno;
if (!fread(&size, sizeof(size), 1, fp)) {
/* Hit the end of file, reserve this slot. */
+ /* Necessary to avoid a later fseek failing on Solaris 10. */
+ if (fseek(fp, 0, SEEK_CUR))
+ return errno;
/* htonl(0) is 0, so no need to worry about byte order */
size = 0;
if (!fwrite(&size, sizeof(size), 1, fp))