Re: closing file in adjust_data_dir

From: Japin Li <japinli(at)hotmail(dot)com>
To: Ted Yu <yuzhihong(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: closing file in adjust_data_dir
Date: 2022-11-16 02:09:00
Message-ID: MEYP282MB166946058F102913829CF1ECB6079@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Wed, 16 Nov 2022 at 10:02, Japin Li <japinli(at)hotmail(dot)com> wrote:
> I think we should check whether fd is NULL or not, otherwise, segmentation
> fault maybe occur.
>
> + if (pclose(fd) != 0)
> + {
> + write_stderr(_("%s: could not close the file following command \"%s\"\n"), progname, cmd);
> + exit(1);
> + }

Sorry for the noise, I misunderstand it.

--
Regrads,
Japin Li.
ChengDu WenWu Information Technology Co.,Ltd.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2022-11-16 02:22:19 Re: Documentation for building with meson
Previous Message Ted Yu 2022-11-16 02:06:34 Re: closing file in adjust_data_dir