1111 *
1212 *
1313 * IDENTIFICATION
14- * $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.35 2000/04/12 17:15:42 momjian Exp $
14+ * $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.35.2.1 2000/09/23 22: 17:12 tgl Exp $
1515 *
1616 *-------------------------------------------------------------------------
1717 */
@@ -105,7 +105,7 @@ smgrinit()
105105if (smgrsw [i ].smgr_init )
106106{
107107if ((* (smgrsw [i ].smgr_init )) ()== SM_FAIL )
108- elog (FATAL ,"initialization failed on %s" ,smgrout (i ));
108+ elog (FATAL ,"initialization failed on %s: %m " ,smgrout (i ));
109109}
110110}
111111
@@ -125,7 +125,7 @@ smgrshutdown(int dummy)
125125if (smgrsw [i ].smgr_shutdown )
126126{
127127if ((* (smgrsw [i ].smgr_shutdown )) ()== SM_FAIL )
128- elog (FATAL ,"shutdown failed on %s" ,smgrout (i ));
128+ elog (FATAL ,"shutdown failed on %s: %m " ,smgrout (i ));
129129}
130130}
131131}
@@ -142,7 +142,7 @@ smgrcreate(int16 which, Relation reln)
142142int fd ;
143143
144144if ((fd = (* (smgrsw [which ].smgr_create )) (reln ))< 0 )
145- elog (ERROR ,"cannot create %s" ,RelationGetRelationName (reln ));
145+ elog (ERROR ,"cannot create %s: %m " ,RelationGetRelationName (reln ));
146146
147147return fd ;
148148}
@@ -158,7 +158,7 @@ smgrunlink(int16 which, Relation reln)
158158int status ;
159159
160160if ((status = (* (smgrsw [which ].smgr_unlink )) (reln ))== SM_FAIL )
161- elog (ERROR ,"cannot unlink %s" ,RelationGetRelationName (reln ));
161+ elog (ERROR ,"cannot unlink %s: %m " ,RelationGetRelationName (reln ));
162162
163163return status ;
164164}
@@ -177,7 +177,7 @@ smgrextend(int16 which, Relation reln, char *buffer)
177177status = (* (smgrsw [which ].smgr_extend )) (reln ,buffer );
178178
179179if (status == SM_FAIL )
180- elog (ERROR ,"%s: cannot extend. Check free disk space." ,
180+ elog (ERROR ,"cannot extend %s: %m.\n\tCheck free disk space." ,
181181RelationGetRelationName (reln ));
182182
183183return status ;
@@ -196,7 +196,7 @@ smgropen(int16 which, Relation reln)
196196
197197if ((fd = (* (smgrsw [which ].smgr_open )) (reln ))< 0 &&
198198!reln -> rd_unlinked )
199- elog (ERROR ,"cannot open %s" ,RelationGetRelationName (reln ));
199+ elog (ERROR ,"cannot open %s: %m " ,RelationGetRelationName (reln ));
200200
201201return fd ;
202202}
216216smgrclose (int16 which ,Relation reln )
217217{
218218if ((* (smgrsw [which ].smgr_close )) (reln )== SM_FAIL )
219- elog (ERROR ,"cannot close %s" ,RelationGetRelationName (reln ));
219+ elog (ERROR ,"cannot close %s: %m " ,RelationGetRelationName (reln ));
220220
221221return SM_SUCCESS ;
222222}
@@ -239,7 +239,7 @@ smgrread(int16 which, Relation reln, BlockNumber blocknum, char *buffer)
239239status = (* (smgrsw [which ].smgr_read )) (reln ,blocknum ,buffer );
240240
241241if (status == SM_FAIL )
242- elog (ERROR ,"cannot read block %d of %s" ,
242+ elog (ERROR ,"cannot read block %d of %s: %m " ,
243243blocknum ,RelationGetRelationName (reln ));
244244
245245return status ;
@@ -261,7 +261,7 @@ smgrwrite(int16 which, Relation reln, BlockNumber blocknum, char *buffer)
261261status = (* (smgrsw [which ].smgr_write )) (reln ,blocknum ,buffer );
262262
263263if (status == SM_FAIL )
264- elog (ERROR ,"cannot write block %d of %s" ,
264+ elog (ERROR ,"cannot write block %d of %s: %m " ,
265265blocknum ,RelationGetRelationName (reln ));
266266
267267return status ;
@@ -278,7 +278,7 @@ smgrflush(int16 which, Relation reln, BlockNumber blocknum, char *buffer)
278278status = (* (smgrsw [which ].smgr_flush )) (reln ,blocknum ,buffer );
279279
280280if (status == SM_FAIL )
281- elog (ERROR ,"cannot flush block %d of %s to stable store" ,
281+ elog (ERROR ,"cannot flush block %d of %s to stable store: %m " ,
282282blocknum ,RelationGetRelationName (reln ));
283283
284284return status ;
@@ -319,7 +319,7 @@ smgrblindwrt(int16 which,
319319blkno ,buffer ,dofsync );
320320
321321if (status == SM_FAIL )
322- elog (ERROR ,"cannot write block %d of %s [%s] blind" ,
322+ elog (ERROR ,"cannot write block %d of %s [%s] blind: %m " ,
323323blkno ,relstr ,dbstr );
324324
325325pfree (dbstr );
@@ -348,7 +348,7 @@ smgrmarkdirty(int16 which,
348348status = (* (smgrsw [which ].smgr_markdirty )) (reln ,blkno );
349349
350350if (status == SM_FAIL )
351- elog (ERROR ,"cannot mark block %d of %s" ,
351+ elog (ERROR ,"cannot mark block %d of %s: %m " ,
352352blkno ,RelationGetRelationName (reln ));
353353
354354return status ;
@@ -380,7 +380,7 @@ smgrblindmarkdirty(int16 which,
380380blkno );
381381
382382if (status == SM_FAIL )
383- elog (ERROR ,"cannot mark block %d of %s [%s] blind" ,
383+ elog (ERROR ,"cannot mark block %d of %s [%s] blind: %m " ,
384384blkno ,relstr ,dbstr );
385385
386386pfree (dbstr );
@@ -402,7 +402,7 @@ smgrnblocks(int16 which, Relation reln)
402402int nblocks ;
403403
404404if ((nblocks = (* (smgrsw [which ].smgr_nblocks )) (reln ))< 0 )
405- elog (ERROR ,"cannot count blocks for %s" ,
405+ elog (ERROR ,"cannot count blocks for %s: %m " ,
406406RelationGetRelationName (reln ));
407407
408408return nblocks ;
@@ -424,7 +424,7 @@ smgrtruncate(int16 which, Relation reln, int nblocks)
424424if (smgrsw [which ].smgr_truncate )
425425{
426426if ((newblks = (* (smgrsw [which ].smgr_truncate )) (reln ,nblocks ))< 0 )
427- elog (ERROR ,"cannot truncate %s to %d blocks" ,
427+ elog (ERROR ,"cannot truncate %s to %d blocks: %m " ,
428428RelationGetRelationName (reln ),nblocks );
429429}
430430
@@ -445,7 +445,7 @@ smgrcommit()
445445if (smgrsw [i ].smgr_commit )
446446{
447447if ((* (smgrsw [i ].smgr_commit )) ()== SM_FAIL )
448- elog (FATAL ,"transaction commit failed on %s" ,smgrout (i ));
448+ elog (FATAL ,"transaction commit failed on %s: %m " ,smgrout (i ));
449449}
450450}
451451
@@ -462,7 +462,7 @@ smgrabort()
462462if (smgrsw [i ].smgr_abort )
463463{
464464if ((* (smgrsw [i ].smgr_abort )) ()== SM_FAIL )
465- elog (FATAL ,"transaction abort failed on %s" ,smgrout (i ));
465+ elog (FATAL ,"transaction abort failed on %s: %m " ,smgrout (i ));
466466}
467467}
468468