Skip to content

Commit 408fa91

Browse files
braydonkedsiper
authored andcommitted
log: address wsa error function comments
Signed-off-by: braydonk <[email protected]>
1 parent 69cab09 commit 408fa91

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

include/fluent-bit/flb_log.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,9 @@ static inline int flb_log_suppress_check(int log_suppress_interval, const char *
232232
int flb_log_worker_init(struct flb_worker *worker);
233233
int flb_log_worker_destroy(struct flb_worker *worker);
234234
int flb_errno_print(int errnum, const char *file, int line);
235+
#ifdef WIN32
235236
int flb_WSAGetLastError_print(int errnum, const char *file, int line);
237+
#endif
236238

237239
#ifdef __FLB_FILENAME__
238240
#define flb_errno() flb_errno_print(errno, __FLB_FILENAME__, __LINE__)

src/flb_log.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@ static inline int log_read(flb_pipefd_t fd, struct flb_log *log)
126126
bytes = flb_pipe_read_all(fd, &msg, sizeof(struct log_message));
127127

128128
if (bytes <= 0) {
129-
flb_pipe_error();
130-
131129
return -1;
132130
}
133131
if (msg.size > sizeof(msg.msg)) {
@@ -750,16 +748,17 @@ int flb_errno_print(int errnum, const char *file, int line)
750748
return 0;
751749
}
752750

751+
#ifdef WIN32
753752
int flb_WSAGetLastError_print(int errnum, const char *file, int line)
754753
{
755-
#ifdef WIN32
756754
char buf[256];
757755
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
758756
NULL, errnum, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
759757
buf, sizeof(buf), NULL);
760758
flb_error("[%s:%i WSAGetLastError=%i] %s", file, line, errnum, buf);
761-
#endif
759+
return 0;
762760
}
761+
#endif
763762

764763
int flb_log_destroy(struct flb_log *log, struct flb_config *config)
765764
{

x.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[INPUT]
2+
Name dummy
3+
4+
[OUTPUT]
5+
Name es
6+
Match *

0 commit comments

Comments
 (0)