Commits

Anonymous committed f52c516

Fix lo_export usage in example programs.

lo_export returns -1, not zero, on failure.

  • Participants
  • Parent commits 0e924c0

Comments (0)

Files changed (2)

File src/test/examples/testlo.c

 
 		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));
 	}
 

File src/test/examples/testlo64.c

 
 		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));
 
 		printf("truncating to 3294968000 bytes\n");
 		my_truncate(conn, lobjOid, 3294968000U);
 
 		printf("exporting truncated large object to file \"%s\" ...\n", out_filename2);
-		if (!lo_export(conn, lobjOid, out_filename2))
+		if (lo_export(conn, lobjOid, out_filename2) < 0)
 			fprintf(stderr, "%s\n", PQerrorMessage(conn));
 	}