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:
@ -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;
|
||||
|
Reference in New Issue
Block a user