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)
35023502 bool 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 {
35073508 if (nread == 0 )
35083509 break ; /* end of file */
@@ -3523,15 +3524,15 @@ load_relcache_init_file(bool shared)
35233524 rel = 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 )
35273528 goto read_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 ))
35313532 goto read_failed ;
35323533
35333534 relform = (Form_pg_class ) palloc (len );
3534- if (( nread = fread (relform , 1 , len , fp ) ) != len )
3535+ if (fread (relform , 1 , len , fp ) != len )
35353536 goto read_failed ;
35363537
35373538 rel -> rd_rel = relform ;
@@ -3548,23 +3549,23 @@ load_relcache_init_file(bool shared)
35483549 has_not_null = false;
35493550 for (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 ))
35523553 goto read_failed ;
35533554 if (len != ATTRIBUTE_FIXED_PART_SIZE )
35543555 goto read_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 )
35563557 goto read_failed ;
35573558
35583559 has_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 ))
35633564 goto read_failed ;
35643565 if (len > 0 )
35653566 {
35663567 rel -> 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 )
35683569 goto read_failed ;
35693570 if (len != VARSIZE (rel -> rd_options ))
35703571 goto read_failed ; /* sanity check */
@@ -3600,23 +3601,23 @@ load_relcache_init_file(bool shared)
36003601 nailed_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 ))
36043605 goto read_failed ;
36053606
36063607 rel -> 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 )
36083609 goto read_failed ;
36093610
36103611 /* Fix up internal pointers in the tuple -- see heap_copytuple */
36113612 rel -> rd_indextuple -> t_data = (HeapTupleHeader ) ((char * ) rel -> rd_indextuple + HEAPTUPLESIZE );
36123613 rel -> 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 ))
36163617 goto read_failed ;
36173618
36183619 am = (Form_pg_am ) palloc (len );
3619- if (( nread = fread (am , 1 , len , fp ) ) != len )
3620+ if (fread (am , 1 , len , fp ) != len )
36203621 goto read_failed ;
36213622 rel -> rd_am = am ;
36223623
@@ -3632,50 +3633,50 @@ load_relcache_init_file(bool shared)
36323633 rel -> 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 ))
36363637 goto read_failed ;
36373638
36383639 opfamily = (Oid * ) MemoryContextAlloc (indexcxt , len );
3639- if (( nread = fread (opfamily , 1 , len , fp ) ) != len )
3640+ if (fread (opfamily , 1 , len , fp ) != len )
36403641 goto read_failed ;
36413642
36423643 rel -> 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 ))
36463647 goto read_failed ;
36473648
36483649 opcintype = (Oid * ) MemoryContextAlloc (indexcxt , len );
3649- if (( nread = fread (opcintype , 1 , len , fp ) ) != len )
3650+ if (fread (opcintype , 1 , len , fp ) != len )
36503651 goto read_failed ;
36513652
36523653 rel -> 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 ))
36563657 goto read_failed ;
36573658
36583659 operator = (Oid * ) MemoryContextAlloc (indexcxt , len );
3659- if (( nread = fread (operator , 1 , len , fp ) ) != len )
3660+ if (fread (operator , 1 , len , fp ) != len )
36603661 goto read_failed ;
36613662
36623663 rel -> 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 ))
36663667 goto read_failed ;
36673668 support = (RegProcedure * ) MemoryContextAlloc (indexcxt , len );
3668- if (( nread = fread (support , 1 , len , fp ) ) != len )
3669+ if (fread (support , 1 , len , fp ) != len )
36693670 goto read_failed ;
36703671
36713672 rel -> 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 ))
36753676 goto read_failed ;
36763677
36773678 indoption = (int16 * ) MemoryContextAlloc (indexcxt , len );
3678- if (( nread = fread (indoption , 1 , len , fp ) ) != len )
3679+ if (fread (indoption , 1 , len , fp ) != len )
36793680 goto read_failed ;
36803681
36813682 rel -> rd_indoption = indoption ;
0 commit comments