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
listenerpipe: 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/