Skip to content

Commit b8b37e4

Browse files
committed
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
1 parent 8e39259 commit b8b37e4

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

contrib/dblink/dblink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1347,7 +1347,7 @@ Datum
13471347
dblink_cancel_query(PG_FUNCTION_ARGS)
13481348
{
13491349
PGconn *conn;
1350-
char *msg;
1350+
const char *msg;
13511351
TimestampTz endtime;
13521352

13531353
dblink_init();

contrib/postgres_fdw/connection.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,7 @@ pgfdw_cancel_query(PGconn *conn)
13321332
static bool
13331333
pgfdw_cancel_query_begin(PGconn *conn, TimestampTz endtime)
13341334
{
1335-
char *errormsg = libpqsrv_cancel(conn, endtime);
1335+
const char *errormsg = libpqsrv_cancel(conn, endtime);
13361336

13371337
if (errormsg != NULL)
13381338
ereport(WARNING,

src/include/libpq/libpq-be-fe-helpers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,11 +382,11 @@ libpqsrv_get_result(PGconn *conn, uint32 wait_event_info)
382382
* Note: this function leaks a string's worth of memory when reporting
383383
* libpq errors. Make sure to call it in a transient memory context.
384384
*/
385-
static inline char *
385+
static inline const char *
386386
libpqsrv_cancel(PGconn *conn, TimestampTz endtime)
387387
{
388388
PGcancelConn *cancel_conn;
389-
char *error = NULL;
389+
const char *error = NULL;
390390

391391
cancel_conn = PQcancelCreate(conn);
392392
if (cancel_conn == NULL)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy