Skip to content

Commit f369207

Browse files
committed
Fix another portability issue in pg_basebackup.
The target of sscanf with a %o format had better be of integer width, but "mode_t" conceivably isn't that. Another compiler warning seen only on some platforms; this one I think is potentially a real bug and not just a warning.
1 parent dd5f0db commit f369207

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/bin/pg_basebackup/pg_basebackup.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
483483

484484
if (file == NULL)
485485
{
486-
mode_t filemode;
486+
int filemode;
487487

488488
/*
489489
* No current file, so this must be the header for a new file
@@ -540,7 +540,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
540540
disconnect_and_exit(1);
541541
}
542542
#ifndef WIN32
543-
if (chmod(fn, filemode))
543+
if (chmod(fn, (mode_t) filemode))
544544
fprintf(stderr, _("%s: could not set permissions on directory \"%s\": %s\n"),
545545
progname, fn, strerror(errno));
546546
#endif
@@ -580,7 +580,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
580580
}
581581

582582
#ifndef WIN32
583-
if (chmod(fn, filemode))
583+
if (chmod(fn, (mode_t) filemode))
584584
fprintf(stderr, _("%s: could not set permissions on file \"%s\": %s\n"),
585585
progname, fn, strerror(errno));
586586
#endif

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