summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2007-03-03 18:50:45 +0000
committerBruce Momjian2007-03-03 18:50:45 +0000
commit053981f4054f6dfcda0ce65566605b49ca366a97 (patch)
tree70a945f114324217e874305605a6d339f93f09b7
parente52c4a6e26f2c5d37cefe42c39b6233d9c0fbe25 (diff)
Add logging to /contrib/pg_standby if -k couldn't clean up the log file.
Darcy Buskermolen
-rw-r--r--contrib/pg_standby/pg_standby.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/contrib/pg_standby/pg_standby.c b/contrib/pg_standby/pg_standby.c
index 98d04c26f0..733b01d133 100644
--- a/contrib/pg_standby/pg_standby.c
+++ b/contrib/pg_standby/pg_standby.c
@@ -264,10 +264,15 @@ CustomizableCleanupPriorWALFiles(void)
#else
snprintf(WALFilePath, MAXPGPATH, "%s/%s", archiveLocation, xlde->d_name);
#endif
- rc = unlink(WALFilePath);
if (debug)
- fprintf(stderr, "\npg_standby: removed \"%s\"\n", WALFilePath);
+ fprintf(stderr, "\npg_standby: removing \"%s\"\n", WALFilePath);
+
+ rc = unlink(WALFilePath);
+ if (rc !=0 )
+ fprintf(stderr, "\npg_standby: ERROR failed to remove \"%s\" because %s\n", WALFilePath, strerror(errno));
+
+
}
}
}
@@ -315,7 +320,7 @@ CheckForExternalTrigger(void)
rc = unlink(triggerPath);
if (rc != 0)
{
- fprintf(stderr, "\n ERROR: unable to remove \"%s\", rc=%d", triggerPath, rc);
+ fprintf(stderr, "\n ERROR: unable to remove \"%s\", because %s", triggerPath, strerror(errno));
fflush(stderr);
exit(rc);
}