diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2024-04-05 18:23:10 +0200 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2024-04-05 18:23:10 +0200 |
commit | b8b37e41ba4aae1e79dcfaeb9eb0fd7549773ff5 (patch) | |
tree | a4def74281eb134cf5e4f94d676f59817dbf9cdb | |
parent | 8e392595e5619734db707553e8f72dfacf9ab86c (diff) | |
download | postgresql-b8b37e41ba4aae1e79dcfaeb9eb0fd7549773ff5.tar.gz postgresql-b8b37e41ba4aae1e79dcfaeb9eb0fd7549773ff5.zip |
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
-rw-r--r-- | contrib/dblink/dblink.c | 2 | ||||
-rw-r--r-- | contrib/postgres_fdw/connection.c | 2 | ||||
-rw-r--r-- | src/include/libpq/libpq-be-fe-helpers.h | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/contrib/dblink/dblink.c b/contrib/dblink/dblink.c index de858e165ab..755293456ff 100644 --- a/contrib/dblink/dblink.c +++ b/contrib/dblink/dblink.c @@ -1347,7 +1347,7 @@ Datum dblink_cancel_query(PG_FUNCTION_ARGS) { PGconn *conn; - char *msg; + const char *msg; TimestampTz endtime; dblink_init(); diff --git a/contrib/postgres_fdw/connection.c b/contrib/postgres_fdw/connection.c index e4595926641..603e043af40 100644 --- a/contrib/postgres_fdw/connection.c +++ b/contrib/postgres_fdw/connection.c @@ -1332,7 +1332,7 @@ pgfdw_cancel_query(PGconn *conn) static bool pgfdw_cancel_query_begin(PGconn *conn, TimestampTz endtime) { - char *errormsg = libpqsrv_cancel(conn, endtime); + const char *errormsg = libpqsrv_cancel(conn, endtime); if (errormsg != NULL) ereport(WARNING, diff --git a/src/include/libpq/libpq-be-fe-helpers.h b/src/include/libpq/libpq-be-fe-helpers.h index 8be9aa1f2f9..fe508292743 100644 --- a/src/include/libpq/libpq-be-fe-helpers.h +++ b/src/include/libpq/libpq-be-fe-helpers.h @@ -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 * 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) { PGcancelConn *cancel_conn; - char *error = NULL; + const char *error = NULL; cancel_conn = PQcancelCreate(conn); if (cancel_conn == NULL) |