Skip to content

Commit 67608a3

Browse files
committed
Make getpid() use %d consistently for printing.
1 parent b3723ae commit 67608a3

File tree

4 files changed

+13
-17
lines changed

4 files changed

+13
-17
lines changed

src/backend/access/transam/xlog.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.171 2004/10/07 15:21:51 momjian Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.172 2004/10/09 02:46:40 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1513,8 +1513,7 @@ XLogFileInit(uint32 log, uint32 seg,
15131513
* up pre-creating an extra log segment. That seems OK, and better
15141514
* than holding the lock throughout this lengthy process.
15151515
*/
1516-
snprintf(tmppath, MAXPGPATH, "%s/xlogtemp.%d",
1517-
XLogDir, (int) getpid());
1516+
snprintf(tmppath, MAXPGPATH, "%s/xlogtemp.%d", XLogDir, getpid());
15181517

15191518
unlink(tmppath);
15201519

@@ -1634,8 +1633,7 @@ XLogFileCopy(uint32 log, uint32 seg,
16341633
/*
16351634
* Copy into a temp file name.
16361635
*/
1637-
snprintf(tmppath, MAXPGPATH, "%s/xlogtemp.%d",
1638-
XLogDir, (int) getpid());
1636+
snprintf(tmppath, MAXPGPATH, "%s/xlogtemp.%d", XLogDir, getpid());
16391637

16401638
unlink(tmppath);
16411639

@@ -2900,8 +2898,7 @@ writeTimeLineHistory(TimeLineID newTLI, TimeLineID parentTLI,
29002898
/*
29012899
* Write into a temp file name.
29022900
*/
2903-
snprintf(tmppath, MAXPGPATH, "%s/xlogtemp.%d",
2904-
XLogDir, (int) getpid());
2901+
snprintf(tmppath, MAXPGPATH, "%s/xlogtemp.%d", XLogDir, getpid());
29052902

29062903
unlink(tmppath);
29072904

src/backend/utils/error/elog.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
*
4343
*
4444
* IDENTIFICATION
45-
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.153 2004/10/09 01:24:47 momjian Exp $
45+
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.154 2004/10/09 02:46:41 momjian Exp $
4646
*
4747
*-------------------------------------------------------------------------
4848
*/
@@ -1364,13 +1364,13 @@ log_line_prefix(StringInfo buf)
13641364
case 'c':
13651365
if (MyProcPort)
13661366
{
1367-
appendStringInfo(buf, "%lx.%lx",
1367+
appendStringInfo(buf, "%lx.%x",
13681368
(long) (MyProcPort->session_start.tv_sec),
1369-
(long) MyProcPid);
1369+
MyProcPid);
13701370
}
13711371
break;
13721372
case 'p':
1373-
appendStringInfo(buf, "%ld", (long) MyProcPid);
1373+
appendStringInfo(buf, "%d", MyProcPid);
13741374
break;
13751375
case 'l':
13761376
appendStringInfo(buf, "%ld", log_line_number);

src/bin/psql/command.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2004, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.126 2004/10/07 15:21:56 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.127 2004/10/09 02:46:41 momjian Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "command.h"
@@ -1132,9 +1132,8 @@ do_edit(const char *filename_arg, PQExpBuffer query_buf)
11321132
#ifndef WIN32
11331133
const char *tmpdirenv = getenv("TMPDIR");
11341134

1135-
snprintf(fnametmp, sizeof(fnametmp), "%s/psql.edit.%ld.%ld",
1136-
tmpdirenv ? tmpdirenv : "/tmp",
1137-
(long) geteuid(), (long) getpid());
1135+
snprintf(fnametmp, sizeof(fnametmp), "%s/psql.edit.%d.%d",
1136+
tmpdirenv ? tmpdirenv : "/tmp", geteuid(), getpid());
11381137
#else
11391138
GetTempFileName(".", "psql", 0, fnametmp);
11401139
#endif

src/interfaces/ecpg/ecpglib/misc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.22 2004/08/29 05:06:59 momjian Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.23 2004/10/09 02:46:42 momjian Exp $ */
22

33
#define POSTGRES_ECPG_INTERNAL
44
#include "postgres_fe.h"
@@ -253,7 +253,7 @@ ECPGlog(const char *format,...)
253253
return;
254254
}
255255

256-
sprintf(f, "[%d]: %s", (int) getpid(), format);
256+
sprintf(f, "[%d]: %s", getpid(), format);
257257

258258
va_start(ap, format);
259259
vfprintf(debugstream, f, ap);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy