You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Eric Covener <co...@gmail.com> on 2008/01/11 22:32:39 UTC

Fwd: svn commit: r608508 - /httpd/httpd/trunk/modules/loggers/mod_log_forensic.c

-        id = apr_psprintf(r->pool, "%x:%lx:%x", getpid(), time(NULL),
+        id = apr_psprintf(r->pool, "%" APR_PID_T_FMT "x:%lx:%x", getpid(),

Stray 'x' in the new format string? No harm AFAICT.

-- 
Eric Covener
covener@gmail.com

Re: Fwd: svn commit: r608508 - /httpd/httpd/trunk/modules/loggers/mod_log_forensic.c

Posted by Ruediger Pluem <rp...@apache.org>.

On 01/11/2008 11:13 PM, Eric Covener wrote:
> On Jan 11, 2008 5:04 PM, Ruediger Pluem <rp...@apache.org> wrote:
>>
>> On 01/11/2008 10:32 PM, Eric Covener wrote:
>>> -        id = apr_psprintf(r->pool, "%x:%lx:%x", getpid(), time(NULL),
>>> +        id = apr_psprintf(r->pool, "%" APR_PID_T_FMT "x:%lx:%x", getpid(),
>>>
>>> Stray 'x' in the new format string? No harm AFAICT.
>> On purpose. Before we had hex aoutput of the pid (don't know why) and there
>> is no APR_PID_T_FMT_HEX- So I concat APR_PID_T_FMT and x to get a hex output
>> I people thing that a hex output of a pid is stupid, well then lets remove the
>> x, but the initial intention of the commit was to remove compiler warning no
>> changing code.
> 
> For APR_PID_T_FMT of 'd' (my vanilla 32-bit linux system) the 'x' ends
> up in the output as in:
> 
> +26737x:4787e90e:0|GET /
> HTTP/1.0|User-Agent:Wget/1.10.2|Accept:*/*|Host:localhost|Connection:Keep-Alive
> -26737x:4787e90e:0

Ok, you convinced me in rereading the printf man page and now I agree that this does
not work as expected :-).
As I see no sense in hex pids anyway (for sure there is a reason why there is no
APR_PID_T_FMT_HEX :-), lets just drop the x.

Regards

RĂ¼diger



Re: Fwd: svn commit: r608508 - /httpd/httpd/trunk/modules/loggers/mod_log_forensic.c

Posted by Eric Covener <co...@gmail.com>.
On Jan 11, 2008 5:04 PM, Ruediger Pluem <rp...@apache.org> wrote:
>
>
> On 01/11/2008 10:32 PM, Eric Covener wrote:
> > -        id = apr_psprintf(r->pool, "%x:%lx:%x", getpid(), time(NULL),
> > +        id = apr_psprintf(r->pool, "%" APR_PID_T_FMT "x:%lx:%x", getpid(),
> >
> > Stray 'x' in the new format string? No harm AFAICT.
>
> On purpose. Before we had hex aoutput of the pid (don't know why) and there
> is no APR_PID_T_FMT_HEX- So I concat APR_PID_T_FMT and x to get a hex output
> I people thing that a hex output of a pid is stupid, well then lets remove the
> x, but the initial intention of the commit was to remove compiler warning no
> changing code.

For APR_PID_T_FMT of 'd' (my vanilla 32-bit linux system) the 'x' ends
up in the output as in:

+26737x:4787e90e:0|GET /
HTTP/1.0|User-Agent:Wget/1.10.2|Accept:*/*|Host:localhost|Connection:Keep-Alive
-26737x:4787e90e:0


-- 
Eric Covener
covener@gmail.com

Re: Fwd: svn commit: r608508 - /httpd/httpd/trunk/modules/loggers/mod_log_forensic.c

Posted by Ruediger Pluem <rp...@apache.org>.

On 01/11/2008 10:32 PM, Eric Covener wrote:
> -        id = apr_psprintf(r->pool, "%x:%lx:%x", getpid(), time(NULL),
> +        id = apr_psprintf(r->pool, "%" APR_PID_T_FMT "x:%lx:%x", getpid(),
> 
> Stray 'x' in the new format string? No harm AFAICT.

On purpose. Before we had hex aoutput of the pid (don't know why) and there
is no APR_PID_T_FMT_HEX- So I concat APR_PID_T_FMT and x to get a hex output
I people thing that a hex output of a pid is stupid, well then lets remove the
x, but the initial intention of the commit was to remove compiler warning no
changing code.

Regards

RĂ¼diger