<tr class="odd"><td><code>%...P</code></td>
<td>The process ID of the child that serviced the request.</td></tr>
<tr><td><code>%...{<var>format</var>}P</code></td>
- <td>The process ID and or thread id of the child that serviced the
- request. Valid formats are <code>pid</code>, <code>tid</code>,
- and <code>pid/tid</code>.</td></tr>
+ <td>The process ID or thread id of the child that serviced the
+ request. Valid formats are <code>pid</code> and <code>tid</code>.
+ </td></tr>
<tr class="odd"><td><code>%...q</code></td>
<td>The query string (prepended with a <code>?</code> if a query
string exists, otherwise an empty string)</td></tr>
<td>The process ID of the child that serviced the request.</td></tr>
<tr><td><code>%...{<var>format</var>}P</code></td>
- <td>The process ID and or thread id of the child that serviced the
- request. Valid formats are <code>pid</code>, <code>tid</code>,
- and <code>pid/tid</code>.</td></tr>
+ <td>The process ID or thread id of the child that serviced the
+ request. Valid formats are <code>pid</code> and <code>tid</code>.
+ </td></tr>
<tr><td><code>%...q</code></td>
<td>The query string (prepended with a <code>?</code> if a query
static const char *log_pid_tid(request_rec *r, char *a)
{
if (*a == '\0' || !strcmp(a, "pid")) {
- return apr_psprintf(r->pool, "%ld", (long)getpid());
+ return apr_psprintf(r->pool, "%" APR_PID_T_FMT, getpid());
}
- else {
+ else if (!strcmp(a, "tid")) {
#if APR_HAS_THREADS
apr_os_thread_t tid = apr_os_thread_current();
#else
int tid = 0; /* APR will format "0" anyway but an arg is needed */
#endif
-
- if (!strcmp(a, "pid/tid")) {
- return apr_psprintf(r->pool, "%ld/%pT", (long)getpid(), &tid);
- }
- else if (!strcmp(a, "tid")) {
- return apr_psprintf(r->pool, "%pT", &tid);
- }
- else { /* bogus string */
- return a;
- }
+ return apr_psprintf(r->pool, "%pT", &tid);
}
+ /* bogus format */
+ return a;
}
static const char *log_connection_status(request_rec *r, char *a)