You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by ma...@apache.org on 2010/02/06 00:49:27 UTC

svn commit: r907131 - in /hadoop/avro/trunk: CHANGES.txt lang/c/src/io.c

Author: massie
Date: Fri Feb  5 23:49:26 2010
New Revision: 907131

URL: http://svn.apache.org/viewvc?rev=907131&view=rev
Log:
AVRO-398. avro_read_file doesn't detect eof (contributed by Eli Collins)

Modified:
    hadoop/avro/trunk/CHANGES.txt
    hadoop/avro/trunk/lang/c/src/io.c

Modified: hadoop/avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/CHANGES.txt?rev=907131&r1=907130&r2=907131&view=diff
==============================================================================
--- hadoop/avro/trunk/CHANGES.txt (original)
+++ hadoop/avro/trunk/CHANGES.txt Fri Feb  5 23:49:26 2010
@@ -307,6 +307,8 @@
     AVRO-402. Add method for writing avro_schema_t structure to an 
               avro_writer_t (massie)
 
+    AVRO-398. avro_read_file doesn't detect eof (Eli Collins via massie)
+
   OPTIMIZATIONS
 
     AVRO-172. More efficient schema processing (massie)

Modified: hadoop/avro/trunk/lang/c/src/io.c
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/src/io.c?rev=907131&r1=907130&r2=907131&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/c/src/io.c (original)
+++ hadoop/avro/trunk/lang/c/src/io.c Fri Feb  5 23:49:26 2010
@@ -155,7 +155,7 @@
 	int rval = fread(buf, len, 1, reader->fp);
 
 	if (rval == 0) {
-		return ferror(reader->fp) ? -1 : 0;
+		return ferror(reader->fp) || feof(reader->fp) ? -1 : 0;
 	}
 	return 0;
 }