1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-05 07:21:24 +03:00

Fix reversed check of return value from sync

While at it also update the comments in walmethods.h to make it less
likely for mistakes like this to appear in the future (thanks to Tom for
improvements to the comments).

And finally, in passing change the return type of walmethod.getlasterror
to being const, also per suggestion from Tom.
This commit is contained in:
Magnus Hagander
2017-04-12 13:43:59 +02:00
parent 587d62d856
commit b935eb7da3
3 changed files with 51 additions and 4 deletions

View File

@ -61,7 +61,7 @@ typedef struct DirectoryMethodFile
#endif
} DirectoryMethodFile;
static char *
static const char *
dir_getlasterror(void)
{
/* Directory method always sets errno, so just use strerror */
@ -406,7 +406,7 @@ static TarMethodData *tar_data = NULL;
#define tar_clear_error() tar_data->lasterror[0] = '\0'
#define tar_set_error(msg) strlcpy(tar_data->lasterror, msg, sizeof(tar_data->lasterror))
static char *
static const char *
tar_getlasterror(void)
{
/*