Skip to content

Commit c9c25a9

Browse files
committed
Clean up unnecessary unportability and compiler warnings by removing the
cmp parameter for pg_scandir(). The code failed to support this anyway for Sun/Windows, so pretending we could accept a parameter other than NULL was just asking for trouble.
1 parent b460b5c commit c9c25a9

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

contrib/pg_upgrade/file.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ copy_file(const char *srcfile, const char *dstfile, bool force)
239239
*/
240240
int
241241
pg_scandir(migratorContext *ctx, const char *dirname,
242-
struct dirent *** namelist, int (*selector) (const struct dirent *),
243-
int (*cmp) (const void *, const void *))
242+
struct dirent ***namelist,
243+
int (*selector) (const struct dirent *))
244244
{
245245
#if defined(sun) || defined(WIN32)
246246
return pg_scandir_internal(ctx, dirname, namelist, selector);
@@ -258,10 +258,10 @@ pg_scandir(migratorContext *ctx, const char *dirname,
258258
*/
259259
#elif defined(freebsd) || defined(bsdi) || defined(darwin) || defined(openbsd)
260260
/* no const */
261-
return scandir(dirname, namelist, (int (*) (struct dirent *)) selector, cmp);
261+
return scandir(dirname, namelist, (int (*) (struct dirent *)) selector, NULL);
262262
#else
263263
/* use const */
264-
return scandir(dirname, namelist, selector, cmp);
264+
return scandir(dirname, namelist, selector, NULL);
265265
#endif
266266
}
267267

contrib/pg_upgrade/pg_upgrade.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ typedef void *pageCnvCtx;
330330

331331
int dir_matching_filenames(const struct dirent *scan_ent);
332332
int pg_scandir(migratorContext *ctx, const char *dirname,
333-
struct dirent ***namelist, int (*selector) (const struct dirent *),
334-
int (*cmp) (const void *, const void *));
333+
struct dirent ***namelist,
334+
int (*selector) (const struct dirent *));
335335
const char *copyAndUpdateFile(migratorContext *ctx,
336336
pageCnvCtx *pageConverter, const char *src,
337337
const char *dst, bool force);

contrib/pg_upgrade/relfilenode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ transfer_single_new_db(migratorContext *ctx, pageCnvCtx *pageConverter,
140140
* Now copy/link any fsm and vm files, if they exist
141141
*/
142142
snprintf(scandir_file_pattern, sizeof(scandir_file_pattern), "%u_", maps[mapnum].old);
143-
numFiles = pg_scandir(ctx, maps[mapnum].old_file, &namelist, dir_matching_filenames, NULL);
143+
numFiles = pg_scandir(ctx, maps[mapnum].old_file, &namelist, dir_matching_filenames);
144144

145145
while (numFiles--)
146146
{
@@ -168,7 +168,7 @@ transfer_single_new_db(migratorContext *ctx, pageCnvCtx *pageConverter,
168168
* copied.
169169
*/
170170
snprintf(scandir_file_pattern, sizeof(scandir_file_pattern), "%u.", maps[mapnum].old);
171-
numFiles = pg_scandir(ctx, maps[mapnum].old_file, &namelist, dir_matching_filenames, NULL);
171+
numFiles = pg_scandir(ctx, maps[mapnum].old_file, &namelist, dir_matching_filenames);
172172

173173
while (numFiles--)
174174
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy