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

Commitb98fd52

Browse files
committed
Silence -Wunused-result warning in contrib/pg_upgrade.
This is just neatnik-ism, but since we do it for comparable code in elog.c,we may as well do it here.
1 parentaa2b237 commitb98fd52

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

‎contrib/pg_upgrade/util.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,18 @@ pg_log(eLogType type, char *fmt,...)
8181
/* fopen() on log_opts.internal might have failed, so check it */
8282
if ((type!=PG_VERBOSE||log_opts.verbose)&&log_opts.internal!=NULL)
8383
{
84-
fwrite(message,strlen(message),1,log_opts.internal);
84+
/*
85+
* There's nothing much we can do about it if fwrite fails, but some
86+
* platforms declare fwrite with warn_unused_result. Do a little
87+
* dance with casting to void to shut up the compiler in such cases.
88+
*/
89+
size_trc;
90+
91+
rc=fwrite(message,strlen(message),1,log_opts.internal);
8592
/* if we are using OVERWRITE_MESSAGE, add newline to log file */
8693
if (strchr(message,'\r')!=NULL)
87-
fwrite("\n",1,1,log_opts.internal);
94+
rc=fwrite("\n",1,1,log_opts.internal);
95+
(void)rc;
8896
fflush(log_opts.internal);
8997
}
9098

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp