Re: Re: Proposed Windows-specific change: Enable crash dumps (like core files)

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: Proposed Windows-specific change: Enable crash dumps (like core files)
Date: 2011-07-10 22:36:14
Message-ID: 4E1A295E.9030103@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/07/2011 4:23 AM, Peter Eisentraut wrote:
> I was going through the GetLastError() calls to unify the printf
> formats, as discussed, and I stumbled across this:
>
> + write_stderr("could not write crash dump to %s: error code %08x\n",
> + dumpPath, GetLastError());
>
> Is there a reason why this uses that particular format, unlike all other
> call sites?
>

Other call site usages include:

errmsg_internal("could not create signal event: %d", (int) GetLastError())
write_stderr("could not create signal listener pipe: error code %d;
retrying\n", (int) GetLastError())

etc, so I presume you're referring to the use of %08x as a format
specifier rather than %d ? The only reason is that ntstatus errors are
typically reported this way - but, really, not all possible errors
arising there would be ntstatus errors. As it's not consistent with the
rest of Pg I don't see any reason not to change it to %d.

--
Craig Ringer

POST Newspapers
276 Onslow Rd, Shenton Park
Ph: 08 9381 3088 Fax: 08 9388 2258
ABN: 50 008 917 717
http://www.postnewspapers.com.au/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2011-07-10 22:44:45 Re: reducing the overhead of frequent table locks, v4
Previous Message Noah Misch 2011-07-10 22:23:04 Re: Kaigai's current patches -- review, commit status