Make libpqsrv_cancel's return const char *, not char *

Per headerscheck's C++ check.

Discussion: https://postgr.es/m/372769.1712179784@sss.pgh.pa.us
pull/159/head
Alvaro Herrera 2 years ago
parent 8e392595e5
commit b8b37e41ba
No known key found for this signature in database
GPG Key ID: 1C20ACB9D5C564AE
  1. 2
      contrib/dblink/dblink.c
  2. 2
      contrib/postgres_fdw/connection.c
  3. 4
      src/include/libpq/libpq-be-fe-helpers.h

@ -1347,7 +1347,7 @@ Datum
dblink_cancel_query(PG_FUNCTION_ARGS) dblink_cancel_query(PG_FUNCTION_ARGS)
{ {
PGconn *conn; PGconn *conn;
char *msg; const char *msg;
TimestampTz endtime; TimestampTz endtime;
dblink_init(); dblink_init();

@ -1332,7 +1332,7 @@ pgfdw_cancel_query(PGconn *conn)
static bool static bool
pgfdw_cancel_query_begin(PGconn *conn, TimestampTz endtime) pgfdw_cancel_query_begin(PGconn *conn, TimestampTz endtime)
{ {
char *errormsg = libpqsrv_cancel(conn, endtime); const char *errormsg = libpqsrv_cancel(conn, endtime);
if (errormsg != NULL) if (errormsg != NULL)
ereport(WARNING, ereport(WARNING,

@ -382,11 +382,11 @@ libpqsrv_get_result(PGconn *conn, uint32 wait_event_info)
* Note: this function leaks a string's worth of memory when reporting * Note: this function leaks a string's worth of memory when reporting
* libpq errors. Make sure to call it in a transient memory context. * libpq errors. Make sure to call it in a transient memory context.
*/ */
static inline char * static inline const char *
libpqsrv_cancel(PGconn *conn, TimestampTz endtime) libpqsrv_cancel(PGconn *conn, TimestampTz endtime)
{ {
PGcancelConn *cancel_conn; PGcancelConn *cancel_conn;
char *error = NULL; const char *error = NULL;
cancel_conn = PQcancelCreate(conn); cancel_conn = PQcancelCreate(conn);
if (cancel_conn == NULL) if (cancel_conn == NULL)

Loading…
Cancel
Save