Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf369207

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 seenonly on some platforms; this one I think is potentially a real bugand not just a warning.
1 parentdd5f0db commitf369207

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_tfilemode;
486+
intfilemode;
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
#ifndefWIN32
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
#ifndefWIN32
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)

[8]ページ先頭

©2009-2025 Movatter.jp