Re: return correct error code from pgtls_init

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Zhihong Yu <zyu(at)yugabyte(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: return correct error code from pgtls_init
Date: 2021-08-17 04:13:39
Message-ID: YRs3c7CBwshznFAE@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 01, 2021 at 06:56:42PM -0700, Zhihong Yu wrote:
> Looking at the -1 return, e.g.
>
> pq_lockarray = malloc(sizeof(pthread_mutex_t) *
> CRYPTO_num_locks());
>
> when pq_lockarray is NULL. We can return errno.
>
> I didn't change call to pthread_mutex_lock() because PGTHREAD_ERROR() is
> used which aborts.

I am not sure what you mean here, and there is nothing wrong with this
code as far as I know, as we would let the caller of pgtls_init() know
that something is wrong.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bossart, Nathan 2021-08-17 04:25:05 Re: archive status ".ready" files may be created too early
Previous Message 李杰 (慎追) 2021-08-17 03:56:33 A problem in ExecModifyTable