]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix lo_export usage in example programs.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 9 Oct 2012 01:19:13 +0000 (21:19 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 9 Oct 2012 01:19:13 +0000 (21:19 -0400)
lo_export returns -1, not zero, on failure.

src/test/examples/testlo.c

index 83e37bd7a1aa0d525f4949477d0ded450a5b82b1..763d3bfce00ec5c79688d4fd1061775b1a1949f1 100644 (file)
@@ -251,7 +251,7 @@ main(int argc, char **argv)
 
                printf("exporting large object to file \"%s\" ...\n", out_filename);
 /*             exportFile(conn, lobjOid, out_filename); */
-               if (!lo_export(conn, lobjOid, out_filename))
+               if (lo_export(conn, lobjOid, out_filename) < 0)
                        fprintf(stderr, "%s\n", PQerrorMessage(conn));
        }