appendStringInfoString(&buf, application_name);
break;
case 'c':
- appendStringInfo(&buf, "%lx.%x", (long) (MyStartTime), MyProcPid);
+ appendStringInfo(&buf, "%" INT64_MODIFIER "x.%x", MyStartTime, MyProcPid);
break;
case 'C':
appendStringInfoString(&buf, cluster_name);
appendStringInfoChar(&buf, ',');
/* session id */
- appendStringInfo(&buf, "%lx.%x", (long) MyStartTime, MyProcPid);
+ appendStringInfo(&buf, "%" INT64_MODIFIER "x.%x", MyStartTime, MyProcPid);
appendStringInfoChar(&buf, ',');
/* Line number */
{
char strfbuf[128];
- snprintf(strfbuf, sizeof(strfbuf) - 1, "%lx.%x",
- (long) (MyStartTime), MyProcPid);
+ snprintf(strfbuf, sizeof(strfbuf) - 1, "%" INT64_MODIFIER "x.%x",
+ MyStartTime, MyProcPid);
appendStringInfo(buf, "%*s", padding, strfbuf);
}
else
- appendStringInfo(buf, "%lx.%x", (long) (MyStartTime), MyProcPid);
+ appendStringInfo(buf, "%" INT64_MODIFIER "x.%x", MyStartTime, MyProcPid);
break;
case 'p':
if (padding != 0)
}
/* Session id */
- appendJSONKeyValueFmt(&buf, "session_id", true, "%lx.%x",
- (long) MyStartTime, MyProcPid);
+ appendJSONKeyValueFmt(&buf, "session_id", true, "%" INT64_MODIFIER "x.%x",
+ MyStartTime, MyProcPid);
/* Line number */
appendJSONKeyValueFmt(&buf, "line_num", false, "%ld", log_line_number);
* both datadir and socket lockfiles; although more stuff may get added to
* the datadir lockfile later.
*/
- snprintf(buffer, sizeof(buffer), "%d\n%s\n%ld\n%d\n%s\n",
+ snprintf(buffer, sizeof(buffer), "%d\n%s\n" INT64_FORMAT "\n%d\n%s\n",
amPostmaster ? (int) my_pid : -((int) my_pid),
DataDir,
- (long) MyStartTime,
+ MyStartTime,
PostPortNumber,
socketDir);
* Allow 2 seconds slop for possible cross-process clock skew.
*/
pmpid = atol(optlines[LOCK_FILE_LINE_PID - 1]);
- pmstart = atol(optlines[LOCK_FILE_LINE_START_TIME - 1]);
+ pmstart = atoll(optlines[LOCK_FILE_LINE_START_TIME - 1]);
if (pmstart >= start_time - 2 &&
#ifndef WIN32
pmpid == pm_pid