mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-30 10:01:14 +02:00
Fix overridden callbacks in pg_rewind.
The <source>_traverse_files functions take a callback for processing files, but both the local and libpq source implementations called the function directly without using the callback argument. While there is no bug right now as the function called is the same as the callback, fix by calling the callback to reduce the risk of subtle bugs in the future. Author: Junwang Zhao <zhjwpku@gmail.com> Reviewed-by: Richard Guo <guofenglinux@gmail.com> Discussion: https://postgr.es/m/CAEG8a3Jdwgh+PZr2zh1=t8apA4Yz8tKq+uubPqoCt14nvWKHEw@mail.gmail.com
This commit is contained in:
parent
e0bb5d0c5b
commit
08237056f8
@ -304,7 +304,7 @@ libpq_traverse_files(rewind_source *source, process_file_callback_t callback)
|
|||||||
else
|
else
|
||||||
type = FILE_TYPE_REGULAR;
|
type = FILE_TYPE_REGULAR;
|
||||||
|
|
||||||
process_source_file(path, type, filesize, link_target);
|
callback(path, type, filesize, link_target);
|
||||||
}
|
}
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ init_local_source(const char *datadir)
|
|||||||
static void
|
static void
|
||||||
local_traverse_files(rewind_source *source, process_file_callback_t callback)
|
local_traverse_files(rewind_source *source, process_file_callback_t callback)
|
||||||
{
|
{
|
||||||
traverse_datadir(((local_source *) source)->datadir, &process_source_file);
|
traverse_datadir(((local_source *) source)->datadir, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
|
Loading…
Reference in New Issue
Block a user