diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-01-23 14:26:51 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-01-23 14:26:51 -0500 |
commit | f36920796ec1335733493f7860d6f2f711c20398 (patch) | |
tree | e45ce9a5c36cdd10c815ea7f317341f1c139e37e | |
parent | dd5f0db96ba68553e3ab2c1d9d117863a5637c67 (diff) | |
download | postgresql-f36920796ec1335733493f7860d6f2f711c20398.tar.gz postgresql-f36920796ec1335733493f7860d6f2f711c20398.zip |
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.
-rw-r--r-- | src/bin/pg_basebackup/pg_basebackup.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c index 8a371504aeb..536303461a6 100644 --- a/src/bin/pg_basebackup/pg_basebackup.c +++ b/src/bin/pg_basebackup/pg_basebackup.c @@ -483,7 +483,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum) if (file == NULL) { - mode_t filemode; + int filemode; /* * No current file, so this must be the header for a new file @@ -540,7 +540,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum) disconnect_and_exit(1); } #ifndef WIN32 - if (chmod(fn, filemode)) + if (chmod(fn, (mode_t) filemode)) fprintf(stderr, _("%s: could not set permissions on directory \"%s\": %s\n"), progname, fn, strerror(errno)); #endif @@ -580,7 +580,7 @@ ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum) } #ifndef WIN32 - if (chmod(fn, filemode)) + if (chmod(fn, (mode_t) filemode)) fprintf(stderr, _("%s: could not set permissions on file \"%s\": %s\n"), progname, fn, strerror(errno)); #endif |