88 *
99 *
1010 * IDENTIFICATION
11- * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.289 2009/08/12 20:53:30 tgl Exp $
11+ * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.290 2009/08/30 17:18:52 tgl Exp $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -3502,7 +3502,8 @@ load_relcache_init_file(bool shared)
35023502bool has_not_null ;
35033503
35043504/* first read the relation descriptor length */
3505- if ((nread = fread (& len ,1 ,sizeof (len ),fp ))!= sizeof (len ))
3505+ nread = fread (& len ,1 ,sizeof (len ),fp );
3506+ if (nread != sizeof (len ))
35063507{
35073508if (nread == 0 )
35083509break ;/* end of file */
@@ -3523,15 +3524,15 @@ load_relcache_init_file(bool shared)
35233524rel = rels [num_rels ++ ]= (Relation )palloc (len );
35243525
35253526/* then, read the Relation structure */
3526- if (( nread = fread (rel ,1 ,len ,fp ) )!= len )
3527+ if (fread (rel ,1 ,len ,fp )!= len )
35273528gotoread_failed ;
35283529
35293530/* next read the relation tuple form */
3530- if (( nread = fread (& len ,1 ,sizeof (len ),fp ) )!= sizeof (len ))
3531+ if (fread (& len ,1 ,sizeof (len ),fp )!= sizeof (len ))
35313532gotoread_failed ;
35323533
35333534relform = (Form_pg_class )palloc (len );
3534- if (( nread = fread (relform ,1 ,len ,fp ) )!= len )
3535+ if (fread (relform ,1 ,len ,fp )!= len )
35353536gotoread_failed ;
35363537
35373538rel -> rd_rel = relform ;
@@ -3548,23 +3549,23 @@ load_relcache_init_file(bool shared)
35483549has_not_null = false;
35493550for (i = 0 ;i < relform -> relnatts ;i ++ )
35503551{
3551- if (( nread = fread (& len ,1 ,sizeof (len ),fp ) )!= sizeof (len ))
3552+ if (fread (& len ,1 ,sizeof (len ),fp )!= sizeof (len ))
35523553gotoread_failed ;
35533554if (len != ATTRIBUTE_FIXED_PART_SIZE )
35543555gotoread_failed ;
3555- if (( nread = fread (rel -> rd_att -> attrs [i ],1 ,len ,fp ) )!= len )
3556+ if (fread (rel -> rd_att -> attrs [i ],1 ,len ,fp )!= len )
35563557gotoread_failed ;
35573558
35583559has_not_null |=rel -> rd_att -> attrs [i ]-> attnotnull ;
35593560}
35603561
35613562/* next read the access method specific field */
3562- if (( nread = fread (& len ,1 ,sizeof (len ),fp ) )!= sizeof (len ))
3563+ if (fread (& len ,1 ,sizeof (len ),fp )!= sizeof (len ))
35633564gotoread_failed ;
35643565if (len > 0 )
35653566{
35663567rel -> rd_options = palloc (len );
3567- if (( nread = fread (rel -> rd_options ,1 ,len ,fp ) )!= len )
3568+ if (fread (rel -> rd_options ,1 ,len ,fp )!= len )
35683569gotoread_failed ;
35693570if (len != VARSIZE (rel -> rd_options ))
35703571gotoread_failed ;/* sanity check */
@@ -3600,23 +3601,23 @@ load_relcache_init_file(bool shared)
36003601nailed_indexes ++ ;
36013602
36023603/* next, read the pg_index tuple */
3603- if (( nread = fread (& len ,1 ,sizeof (len ),fp ) )!= sizeof (len ))
3604+ if (fread (& len ,1 ,sizeof (len ),fp )!= sizeof (len ))
36043605gotoread_failed ;
36053606
36063607rel -> rd_indextuple = (HeapTuple )palloc (len );
3607- if (( nread = fread (rel -> rd_indextuple ,1 ,len ,fp ) )!= len )
3608+ if (fread (rel -> rd_indextuple ,1 ,len ,fp )!= len )
36083609gotoread_failed ;
36093610
36103611/* Fix up internal pointers in the tuple -- see heap_copytuple */
36113612rel -> rd_indextuple -> t_data = (HeapTupleHeader ) ((char * )rel -> rd_indextuple + HEAPTUPLESIZE );
36123613rel -> rd_index = (Form_pg_index )GETSTRUCT (rel -> rd_indextuple );
36133614
36143615/* next, read the access method tuple form */
3615- if (( nread = fread (& len ,1 ,sizeof (len ),fp ) )!= sizeof (len ))
3616+ if (fread (& len ,1 ,sizeof (len ),fp )!= sizeof (len ))
36163617gotoread_failed ;
36173618
36183619am = (Form_pg_am )palloc (len );
3619- if (( nread = fread (am ,1 ,len ,fp ) )!= len )
3620+ if (fread (am ,1 ,len ,fp )!= len )
36203621gotoread_failed ;
36213622rel -> rd_am = am ;
36223623
@@ -3632,50 +3633,50 @@ load_relcache_init_file(bool shared)
36323633rel -> rd_indexcxt = indexcxt ;
36333634
36343635/* next, read the vector of opfamily OIDs */
3635- if (( nread = fread (& len ,1 ,sizeof (len ),fp ) )!= sizeof (len ))
3636+ if (fread (& len ,1 ,sizeof (len ),fp )!= sizeof (len ))
36363637gotoread_failed ;
36373638
36383639opfamily = (Oid * )MemoryContextAlloc (indexcxt ,len );
3639- if (( nread = fread (opfamily ,1 ,len ,fp ) )!= len )
3640+ if (fread (opfamily ,1 ,len ,fp )!= len )
36403641gotoread_failed ;
36413642
36423643rel -> rd_opfamily = opfamily ;
36433644
36443645/* next, read the vector of opcintype OIDs */
3645- if (( nread = fread (& len ,1 ,sizeof (len ),fp ) )!= sizeof (len ))
3646+ if (fread (& len ,1 ,sizeof (len ),fp )!= sizeof (len ))
36463647gotoread_failed ;
36473648
36483649opcintype = (Oid * )MemoryContextAlloc (indexcxt ,len );
3649- if (( nread = fread (opcintype ,1 ,len ,fp ) )!= len )
3650+ if (fread (opcintype ,1 ,len ,fp )!= len )
36503651gotoread_failed ;
36513652
36523653rel -> rd_opcintype = opcintype ;
36533654
36543655/* next, read the vector of operator OIDs */
3655- if (( nread = fread (& len ,1 ,sizeof (len ),fp ) )!= sizeof (len ))
3656+ if (fread (& len ,1 ,sizeof (len ),fp )!= sizeof (len ))
36563657gotoread_failed ;
36573658
36583659operator = (Oid * )MemoryContextAlloc (indexcxt ,len );
3659- if (( nread = fread (operator ,1 ,len ,fp ) )!= len )
3660+ if (fread (operator ,1 ,len ,fp )!= len )
36603661gotoread_failed ;
36613662
36623663rel -> rd_operator = operator ;
36633664
36643665/* next, read the vector of support procedures */
3665- if (( nread = fread (& len ,1 ,sizeof (len ),fp ) )!= sizeof (len ))
3666+ if (fread (& len ,1 ,sizeof (len ),fp )!= sizeof (len ))
36663667gotoread_failed ;
36673668support = (RegProcedure * )MemoryContextAlloc (indexcxt ,len );
3668- if (( nread = fread (support ,1 ,len ,fp ) )!= len )
3669+ if (fread (support ,1 ,len ,fp )!= len )
36693670gotoread_failed ;
36703671
36713672rel -> rd_support = support ;
36723673
36733674/* finally, read the vector of indoption values */
3674- if (( nread = fread (& len ,1 ,sizeof (len ),fp ) )!= sizeof (len ))
3675+ if (fread (& len ,1 ,sizeof (len ),fp )!= sizeof (len ))
36753676gotoread_failed ;
36763677
36773678indoption = (int16 * )MemoryContextAlloc (indexcxt ,len );
3678- if (( nread = fread (indoption ,1 ,len ,fp ) )!= len )
3679+ if (fread (indoption ,1 ,len ,fp )!= len )
36793680gotoread_failed ;
36803681
36813682rel -> rd_indoption = indoption ;