1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-09 22:41:56 +03:00

Fix some issues in pg_rewind.

* Remove invalid option character "N" from the third argument (valid option
string) of getopt_long().

* Use pg_free() or pfree() to free the memory allocated by pg_malloc() or
palloc() instead of always using free().

* Assume problem is no disk space if write() fails but doesn't set errno.

* Fix several typos.

Patch by me. Review by Michael Paquier.
This commit is contained in:
Fujii Masao
2015-06-11 22:31:18 +09:00
parent aacb8b9277
commit 966c37fdb5
7 changed files with 20 additions and 14 deletions

View File

@ -105,10 +105,16 @@ write_target_range(char *buf, off_t begin, size_t size)
{
int writelen;
errno = 0;
writelen = write(dstfd, p, writeleft);
if (writelen < 0)
{
/* if write didn't set errno, assume problem is no disk space */
if (errno == 0)
errno = ENOSPC;
pg_fatal("could not write file \"%s\": %s\n",
dstpath, strerror(errno));
}
p += writelen;
writeleft -= writelen;