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

Commitf52c516

Browse files
committed
Fix lo_export usage in example programs.
lo_export returns -1, not zero, on failure.
1 parent0e924c0 commitf52c516

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

‎src/test/examples/testlo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ main(int argc, char **argv)
251251

252252
printf("exporting large object to file \"%s\" ...\n",out_filename);
253253
/*exportFile(conn, lobjOid, out_filename); */
254-
if (!lo_export(conn,lobjOid,out_filename))
254+
if (lo_export(conn,lobjOid,out_filename)<0)
255255
fprintf(stderr,"%s\n",PQerrorMessage(conn));
256256
}
257257

‎src/test/examples/testlo64.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,14 +275,14 @@ main(int argc, char **argv)
275275

276276
printf("exporting large object to file \"%s\" ...\n",out_filename);
277277
/*exportFile(conn, lobjOid, out_filename); */
278-
if (!lo_export(conn,lobjOid,out_filename))
278+
if (lo_export(conn,lobjOid,out_filename)<0)
279279
fprintf(stderr,"%s\n",PQerrorMessage(conn));
280280

281281
printf("truncating to 3294968000 bytes\n");
282282
my_truncate(conn,lobjOid,3294968000U);
283283

284284
printf("exporting truncated large object to file \"%s\" ...\n",out_filename2);
285-
if (!lo_export(conn,lobjOid,out_filename2))
285+
if (lo_export(conn,lobjOid,out_filename2)<0)
286286
fprintf(stderr,"%s\n",PQerrorMessage(conn));
287287
}
288288

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp