diff options
Diffstat (limited to 'src/interfaces')
-rw-r--r-- | src/interfaces/libpq/fe-auth.c | 6 | ||||
-rw-r--r-- | src/interfaces/libpq/fe-connect.c | 18 | ||||
-rw-r--r-- | src/interfaces/libpq/fe-lobj.c | 14 | ||||
-rw-r--r-- | src/interfaces/libpq/fe-misc.c | 2 | ||||
-rw-r--r-- | src/interfaces/libpq/fe-secure-openssl.c | 12 | ||||
-rw-r--r-- | src/interfaces/libpq/fe-secure.c | 4 | ||||
-rw-r--r-- | src/interfaces/libpq/libpq-int.h | 2 |
7 files changed, 29 insertions, 29 deletions
diff --git a/src/interfaces/libpq/fe-auth.c b/src/interfaces/libpq/fe-auth.c index 540aba98b37..92641fe5e9a 100644 --- a/src/interfaces/libpq/fe-auth.c +++ b/src/interfaces/libpq/fe-auth.c @@ -756,11 +756,11 @@ pg_local_sendauth(PGconn *conn) if (sendmsg(conn->sock, &msg, 0) == -1) { - char sebuf[256]; + char sebuf[PG_STRERROR_R_BUFLEN]; printfPQExpBuffer(&conn->errorMessage, "pg_local_sendauth: sendmsg: %s\n", - pqStrerror(errno, sebuf, sizeof(sebuf))); + strerror_r(errno, sebuf, sizeof(sebuf))); return STATUS_ERROR; } return STATUS_OK; @@ -1098,7 +1098,7 @@ pg_fe_getauthname(PQExpBuffer errorMessage) printfPQExpBuffer(errorMessage, libpq_gettext("could not look up local user ID %d: %s\n"), (int) user_id, - pqStrerror(pwerr, pwdbuf, sizeof(pwdbuf))); + strerror_r(pwerr, pwdbuf, sizeof(pwdbuf))); else printfPQExpBuffer(errorMessage, libpq_gettext("local user with ID %d does not exist\n"), diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index 45bc067921c..d001bc513d3 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -1459,7 +1459,7 @@ connectNoDelay(PGconn *conn) (char *) &on, sizeof(on)) < 0) { - char sebuf[256]; + char sebuf[PG_STRERROR_R_BUFLEN]; appendPQExpBuffer(&conn->errorMessage, libpq_gettext("could not set socket to TCP no delay mode: %s\n"), @@ -1480,7 +1480,7 @@ connectNoDelay(PGconn *conn) static void connectFailureMessage(PGconn *conn, int errorno) { - char sebuf[256]; + char sebuf[PG_STRERROR_R_BUFLEN]; #ifdef HAVE_UNIX_SOCKETS if (IS_AF_UNIX(conn->raddr.addr.ss_family)) @@ -1637,7 +1637,7 @@ setKeepalivesIdle(PGconn *conn) if (setsockopt(conn->sock, IPPROTO_TCP, PG_TCP_KEEPALIVE_IDLE, (char *) &idle, sizeof(idle)) < 0) { - char sebuf[256]; + char sebuf[PG_STRERROR_R_BUFLEN]; appendPQExpBuffer(&conn->errorMessage, libpq_gettext("setsockopt(%s) failed: %s\n"), @@ -1671,7 +1671,7 @@ setKeepalivesInterval(PGconn *conn) if (setsockopt(conn->sock, IPPROTO_TCP, TCP_KEEPINTVL, (char *) &interval, sizeof(interval)) < 0) { - char sebuf[256]; + char sebuf[PG_STRERROR_R_BUFLEN]; appendPQExpBuffer(&conn->errorMessage, libpq_gettext("setsockopt(%s) failed: %s\n"), @@ -1706,7 +1706,7 @@ setKeepalivesCount(PGconn *conn) if (setsockopt(conn->sock, IPPROTO_TCP, TCP_KEEPCNT, (char *) &count, sizeof(count)) < 0) { - char sebuf[256]; + char sebuf[PG_STRERROR_R_BUFLEN]; appendPQExpBuffer(&conn->errorMessage, libpq_gettext("setsockopt(%s) failed: %s\n"), @@ -2036,7 +2036,7 @@ PQconnectPoll(PGconn *conn) bool reset_connection_state_machine = false; bool need_new_connection = false; PGresult *res; - char sebuf[256]; + char sebuf[PG_STRERROR_R_BUFLEN]; int optval; PQExpBufferData savedMessage; @@ -2580,7 +2580,7 @@ keep_going: /* We will come back to here until there is else appendPQExpBuffer(&conn->errorMessage, libpq_gettext("could not get peer credentials: %s\n"), - pqStrerror(errno, sebuf, sizeof(sebuf))); + strerror_r(errno, sebuf, sizeof(sebuf))); goto error_return; } @@ -2591,7 +2591,7 @@ keep_going: /* We will come back to here until there is appendPQExpBuffer(&conn->errorMessage, libpq_gettext("could not look up local user ID %d: %s\n"), (int) uid, - pqStrerror(passerr, sebuf, sizeof(sebuf))); + strerror_r(passerr, sebuf, sizeof(sebuf))); else appendPQExpBuffer(&conn->errorMessage, libpq_gettext("local user with ID %d does not exist\n"), @@ -3953,7 +3953,7 @@ internal_cancel(SockAddr *raddr, int be_pid, int be_key, { int save_errno = SOCK_ERRNO; pgsocket tmpsock = PGINVALID_SOCKET; - char sebuf[256]; + char sebuf[PG_STRERROR_R_BUFLEN]; int maxlen; struct { diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index a5ad3af2580..b9caa229669 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -694,7 +694,7 @@ lo_import_internal(PGconn *conn, const char *filename, Oid oid) char buf[LO_BUFSIZE]; Oid lobjOid; int lobj; - char sebuf[256]; + char sebuf[PG_STRERROR_R_BUFLEN]; /* * open the file to be read in @@ -704,7 +704,7 @@ lo_import_internal(PGconn *conn, const char *filename, Oid oid) { /* error */ printfPQExpBuffer(&conn->errorMessage, libpq_gettext("could not open file \"%s\": %s\n"), - filename, pqStrerror(errno, sebuf, sizeof(sebuf))); + filename, strerror_r(errno, sebuf, sizeof(sebuf))); return InvalidOid; } @@ -760,7 +760,7 @@ lo_import_internal(PGconn *conn, const char *filename, Oid oid) printfPQExpBuffer(&conn->errorMessage, libpq_gettext("could not read from file \"%s\": %s\n"), filename, - pqStrerror(save_errno, sebuf, sizeof(sebuf))); + strerror_r(save_errno, sebuf, sizeof(sebuf))); return InvalidOid; } @@ -789,7 +789,7 @@ lo_export(PGconn *conn, Oid lobjId, const char *filename) tmp; char buf[LO_BUFSIZE]; int lobj; - char sebuf[256]; + char sebuf[PG_STRERROR_R_BUFLEN]; /* * open the large object. @@ -814,7 +814,7 @@ lo_export(PGconn *conn, Oid lobjId, const char *filename) printfPQExpBuffer(&conn->errorMessage, libpq_gettext("could not open file \"%s\": %s\n"), filename, - pqStrerror(save_errno, sebuf, sizeof(sebuf))); + strerror_r(save_errno, sebuf, sizeof(sebuf))); return -1; } @@ -834,7 +834,7 @@ lo_export(PGconn *conn, Oid lobjId, const char *filename) printfPQExpBuffer(&conn->errorMessage, libpq_gettext("could not write to file \"%s\": %s\n"), filename, - pqStrerror(save_errno, sebuf, sizeof(sebuf))); + strerror_r(save_errno, sebuf, sizeof(sebuf))); return -1; } } @@ -857,7 +857,7 @@ lo_export(PGconn *conn, Oid lobjId, const char *filename) { printfPQExpBuffer(&conn->errorMessage, libpq_gettext("could not write to file \"%s\": %s\n"), - filename, pqStrerror(errno, sebuf, sizeof(sebuf))); + filename, strerror_r(errno, sebuf, sizeof(sebuf))); result = -1; } diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 2a6637fdda3..46ece1a14c8 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -1071,7 +1071,7 @@ pqSocketCheck(PGconn *conn, int forRead, int forWrite, time_t end_time) if (result < 0) { - char sebuf[256]; + char sebuf[PG_STRERROR_R_BUFLEN]; printfPQExpBuffer(&conn->errorMessage, libpq_gettext("select() failed: %s\n"), diff --git a/src/interfaces/libpq/fe-secure-openssl.c b/src/interfaces/libpq/fe-secure-openssl.c index bbae8eff813..beca3492e8d 100644 --- a/src/interfaces/libpq/fe-secure-openssl.c +++ b/src/interfaces/libpq/fe-secure-openssl.c @@ -142,7 +142,7 @@ pgtls_read(PGconn *conn, void *ptr, size_t len) { ssize_t n; int result_errno = 0; - char sebuf[256]; + char sebuf[PG_STRERROR_R_BUFLEN]; int err; unsigned long ecode; @@ -272,7 +272,7 @@ pgtls_write(PGconn *conn, const void *ptr, size_t len) { ssize_t n; int result_errno = 0; - char sebuf[256]; + char sebuf[PG_STRERROR_R_BUFLEN]; int err; unsigned long ecode; @@ -443,7 +443,7 @@ pgtls_get_peer_certificate_hash(PGconn *conn, size_t *len) return cert_hash; } -#endif /* HAVE_X509_GET_SIGNATURE_NID */ +#endif /* HAVE_X509_GET_SIGNATURE_NID */ /* ------------------------------------------------------------ */ /* OpenSSL specific code */ @@ -780,7 +780,7 @@ initialize_SSL(PGconn *conn) struct stat buf; char homedir[MAXPGPATH]; char fnbuf[MAXPGPATH]; - char sebuf[256]; + char sebuf[PG_STRERROR_R_BUFLEN]; bool have_homedir; bool have_cert; bool have_rootcert; @@ -941,7 +941,7 @@ initialize_SSL(PGconn *conn) { printfPQExpBuffer(&conn->errorMessage, libpq_gettext("could not open certificate file \"%s\": %s\n"), - fnbuf, pqStrerror(errno, sebuf, sizeof(sebuf))); + fnbuf, strerror_r(errno, sebuf, sizeof(sebuf))); SSL_CTX_free(SSL_context); return -1; } @@ -1212,7 +1212,7 @@ open_client_SSL(PGconn *conn) case SSL_ERROR_SYSCALL: { - char sebuf[256]; + char sebuf[PG_STRERROR_R_BUFLEN]; if (r == -1) printfPQExpBuffer(&conn->errorMessage, diff --git a/src/interfaces/libpq/fe-secure.c b/src/interfaces/libpq/fe-secure.c index f7dc249bf0c..a06fc7dc824 100644 --- a/src/interfaces/libpq/fe-secure.c +++ b/src/interfaces/libpq/fe-secure.c @@ -233,7 +233,7 @@ pqsecure_raw_read(PGconn *conn, void *ptr, size_t len) { ssize_t n; int result_errno = 0; - char sebuf[256]; + char sebuf[PG_STRERROR_R_BUFLEN]; n = recv(conn->sock, ptr, len, 0); @@ -311,7 +311,7 @@ pqsecure_raw_write(PGconn *conn, const void *ptr, size_t len) ssize_t n; int flags = 0; int result_errno = 0; - char sebuf[256]; + char sebuf[PG_STRERROR_R_BUFLEN]; DECLARE_SIGPIPE_INFO(spinfo); diff --git a/src/interfaces/libpq/libpq-int.h b/src/interfaces/libpq/libpq-int.h index bdd8f9d9b29..975ab33d025 100644 --- a/src/interfaces/libpq/libpq-int.h +++ b/src/interfaces/libpq/libpq-int.h @@ -773,7 +773,7 @@ extern char *libpq_ngettext(const char *msgid, const char *msgid_plural, unsigne #define SOCK_ERRNO_SET(e) WSASetLastError(e) #else #define SOCK_ERRNO errno -#define SOCK_STRERROR pqStrerror +#define SOCK_STRERROR strerror_r #define SOCK_ERRNO_SET(e) (errno = (e)) #endif |