@@ -883,30 +883,34 @@ static int32
883883read_pq_int32 (FILE * f )
884884{
885885 int32 val ;
886- fread (& val , sizeof (val ), 1 , f );
886+ if (fread (& val , sizeof (val ), 1 , f ) != 1 )
887+ pg_fatal ("could not read from file: %m" );
887888 return pg_hton32 (val );
888889}
889890
890891static int64
891892read_pq_int64 (FILE * f )
892893{
893894 int64 val ;
894- fread (& val , sizeof (val ), 1 , f );
895+ if (fread (& val , sizeof (val ), 1 , f ) != 1 )
896+ pg_fatal ("could not read from file: %m" );
895897 return pg_hton64 (val );
896898}
897899
898900static void
899901write_pq_int32 (FILE * f , int32 val )
900902{
901903 val = pg_hton32 (val );
902- fwrite (& val , sizeof (val ), 1 , f );
904+ if (fwrite (& val , sizeof (val ), 1 , f ) != 1 )
905+ pg_fatal ("could not write to file: %m" );
903906}
904907
905908static void
906909write_pq_int64 (FILE * f , int64 val )
907910{
908911 val = pg_hton64 (val );
909- fwrite (& val , sizeof (val ), 1 , f );
912+ if (fwrite (& val , sizeof (val ), 1 , f ) != 1 )
913+ pg_fatal ("could not write to file: %m" );
910914}
911915
912916static void
0 commit comments