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

Commit03056c7

Browse files
committed
Disable logging to file in agent
1 parent0df77d0 commit03056c7

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

‎src/utils/file.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,15 +268,23 @@ FILE* fio_fopen(char const* path, char const* mode, fio_location location)
268268
FILE*f;
269269
if (fio_is_remote(location))
270270
{
271-
intflags=O_RDWR|O_CREAT|PG_BINARY|(strchr(mode,'+') ?0 :O_TRUNC);
272-
intfd=fio_open(path,flags,location);
271+
intflags=O_RDWR|O_CREAT;
272+
intfd;
273+
if (strcmp(mode,PG_BINARY_W)==0) {
274+
flags |=O_TRUNC|PG_BINARY;
275+
}elseif (strncmp(mode,PG_BINARY_R,strlen(PG_BINARY_R))==0) {
276+
flags |=PG_BINARY;
277+
}elseif (strcmp(mode,"a")==0) {
278+
flags |=O_APPEND;
279+
}
280+
fd=fio_open(path,flags,location);
273281
f= (FILE*)(size_t)((fd+1)& ~FIO_PIPE_MARKER);
274282
}
275283
else
276284
{
277285
f=fopen(path,mode);
278286
if (f==NULL&&strcmp(mode,PG_BINARY_R"+")==0)
279-
f=fopen(path,PG_BINARY_W);
287+
f=fopen(path,PG_BINARY_W);
280288
}
281289
returnf;
282290
}

‎src/utils/logger.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,10 @@ elog_internal(int elevel, bool file_only, const char *message)
157157
time_tlog_time= (time_t)time(NULL);
158158
charstrfbuf[128];
159159

160-
write_to_file=elevel >=logger_config.log_level_file&&
161-
logger_config.log_directory&&logger_config.log_directory[0]!='\0';
160+
write_to_file=elevel >=logger_config.log_level_file
161+
&&logger_config.log_directory
162+
&&logger_config.log_directory[0]!='\0'
163+
&& !remote_agent;
162164
write_to_error_log=elevel >=ERROR&&logger_config.error_log_filename&&
163165
logger_config.log_directory&&logger_config.log_directory[0]!='\0';
164166
write_to_stderr=elevel >= (remote_agent ?ERROR :logger_config.log_level_console)&& !file_only;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp