Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit93b57eb

Browse files
committed
trace.patch (compilation error) the gettimeofday doesn't compile under Linux with glibc2 because the DST_NONE constant is no more defined. It seems that this code (written by me) has always be wrong but for some reason working.From: Massimo Dal Zotto <dz@cs.unitn.it>
1 parentdbaab4a commit93b57eb

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

‎src/backend/utils/misc/trace.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212
#include<stdio.h>
1313
#include<string.h>
14-
#include<time.h>
1514
#include<stdarg.h>
1615
#include<unistd.h>
1716
#include<signal.h>
17+
#include<sys/time.h>
1818
#include<sys/types.h>
1919
#include<sys/stat.h>
2020
#include<fcntl.h>
@@ -47,7 +47,7 @@
4747
* Trace option names, must match the constants in trace_opts[].
4848
*/
4949
staticchar*opt_names[]= {
50-
"all",
50+
"all",/* 0=trace some, 1=trace all, -1=trace none */
5151
"verbose",
5252
"query",
5353
"plan",
@@ -73,6 +73,8 @@ static char *opt_names[] = {
7373
"syslog",/* use syslog for error messages */
7474
"hostlookup",/* enable hostname lookup in ps_status */
7575
"showportnumber",/* show port number in ps_status */
76+
77+
/* NUM_PG_OPTIONS *//* must be the last item of enum */
7678
};
7779

7880
/*
@@ -92,7 +94,6 @@ tprintf(int flag, const char *fmt,...)
9294

9395
#ifdefUSE_SYSLOG
9496
intlog_level;
95-
9697
#endif
9798

9899
if ((flag==TRACE_ALL)|| (pg_options[TRACE_ALL]>0))
@@ -208,7 +209,6 @@ write_syslog(int level, char *line)
208209
syslog(level,"%s",line);
209210
}
210211
}
211-
212212
#endif
213213

214214
#ifdefELOG_TIMESTAMPS
@@ -219,24 +219,24 @@ char *
219219
tprintf_timestamp()
220220
{
221221
structtimevaltv;
222+
structtimezonetz= {0,0 };
222223
structtm*time;
223224
time_ttm;
224225
staticchartimestamp[32],
225226
pid[8];
226227

227-
gettimeofday(&tv,DST_NONE);
228+
gettimeofday(&tv,&tz);
228229
tm=tv.tv_sec;
229230
time=localtime(&tm);
230231

231232
sprintf(pid,"[%d]",MyProcPid);
232233
sprintf(timestamp,"%02d%02d%02d.%02d:%02d:%02d.%03d %7s ",
233234
time->tm_year,time->tm_mon+1,time->tm_mday,
234235
time->tm_hour,time->tm_min,time->tm_sec,
235-
tv.tv_usec /1000,pid);
236+
(int) (tv.tv_usec/1000),pid);
236237

237238
returntimestamp;
238239
}
239-
240240
#endif
241241

242242
#ifdefNOT_USED

‎src/include/utils/trace.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,8 @@ extern void read_pg_options(SIGNAL_ARGS);
3737
* Trace options, used as index into pg_options.
3838
* Must match the constants in pg_options[].
3939
*/
40-
enumpg_option_enum
41-
{
42-
TRACE_ALL,/* 0=trace some, 1=trace all, -1=trace
43-
* none */
40+
enumpg_option_enum {
41+
TRACE_ALL,/* 0=trace some, 1=trace all, -1=trace none */
4442
TRACE_VERBOSE,
4543
TRACE_QUERY,
4644
TRACE_PLAN,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp