example.com
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
List overview
Download
devel
January 2021
----- 2024 -----
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
devel@uclibc-ng.org
4 participants
2 discussions
Start a n
N
ew thread
Unable to output syslog message immediately after restarting the log daemon.
by Takeru Fukushima
Hi, Unable to output messages in syslog function immediately after restarting the log daemon. Caused by ECONNREFUSED on errno in the following __vsyslog function. (libc/misc/syslog/syslog.c) void __vsyslog(int pri, const char *fmt, va_list ap) { . . . retry: if (LogFile >= 0) { do { /* can't just use write, it can result in SIGPIPE */ rc = send(LogFile, p, last_chr + 1 - p, MSG_NOSIGNAL); if (rc < 0) { switch (errno) { case EINTR: break; case ECONNRESET: /* syslogd restarted, reopen log */ closelog_intern(1); openlog_intern(); goto retry; case EAGAIN: /* syslogd stalled, noting we can do */ default: closelog_intern(1); /* 1: do not reset LogXXX globals to default */ goto write_err; } rc = 0; } p += rc; } while (p <= last_chr); goto getout; } . . . You can check it with the following sample. #include <stdio.h> #include <string.h> #include <syslog.h> #include <time.h> #include <errno.h> #include <sys/types.h> #include <sys/socket.h> #include <unistd.h> #include <sys/file.h> #include <sys/signal.h> #include <sys/syslog.h> static const struct sockaddr SyslogAddr = { .sa_family = AF_UNIX, .sa_data = "/dev/log" }; static int LogFile; static int OpenLogSocket(void); int main(void) { char tbuf[1024]; char strbuf[1024]; time_t now; int rc, count = 0; printf("\nSyslog loop start!\n\n"); if (0 == OpenLogSocket() ) { return 1; } while (fgets(strbuf, 1024, stdin)) { if ((char)'e' == strbuf[0]) { printf("Syslog loop end\n"); break; } (void)time(&now); sprintf(tbuf, "<%d>%.15s Test %u", LOG_USER | LOG_NOTICE, ctime(&now) + 4, count++); retry: rc = send(LogFile, tbuf, strlen(tbuf), MSG_NOSIGNAL); if (rc < 0) { switch (errno) { case EINTR: printf("Syslog send error EINTR\n"); break; case ECONNRESET: // case ECONNREFUSED: close(LogFile); if (0 == OpenLogSocket() ) { return 1; } goto retry; case EAGAIN: printf("Syslog send error EAGAIN\n"); break; default: printf("Syslog send error default (%d)\n", errno); break; } } } close(LogFile); return 0; } int OpenLogSocket(void) { int FdFlag; const struct timeval tv = { 1, 0 }; LogFile = socket(AF_UNIX, SOCK_DGRAM, 0); if (-1 == LogFile) { printf("Syslog open error\n"); return 0; } fcntl(LogFile, F_SETFD, FD_CLOEXEC); FdFlag = fcntl(LogFile, F_GETFL); fcntl(LogFile, F_SETFL, O_NONBLOCK | FdFlag); if (-1 != connect(LogFile, &SyslogAddr, sizeof(SyslogAddr))) { fcntl(LogFile, F_SETFL, ~O_NONBLOCK & fcntl(LogFile, F_GETFL)); setsockopt(LogFile, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv)); } else { printf("Syslog connect error\n"); close(LogFile); return 0; } return 1; } When you run the sample, you can send the syslog by return input. If the log daemon is restarted without exiting the sample, the syslog cannot be sent. If you delete the comment (//) in the sample, you can send the syslog. OS:OpenWrt Chaos Calmer 15.05.1 Linux-3.14.77 uClibc-ng-1.0.14 I think it needs to be at least ECONNREFUSED. Thanks, -- Takeru Fukushima
3 years, 9 months
2
2
0
0
[PATCH] extra/locale: fix gen_wc8bit diagnostic output
by Max Filippov
Diagnostic for missing UTF locale is printed to stdout instead of stderr, fix that. Signed-off-by: Max Filippov <jcmvbkbc(a)gmail.com> --- extra/locale/gen_wc8bit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extra/locale/gen_wc8bit.c b/extra/locale/gen_wc8bit.c index 8031df1cf4a5..110541ad5ccc 100644 --- a/extra/locale/gen_wc8bit.c +++ b/extra/locale/gen_wc8bit.c @@ -121,7 +121,8 @@ int main(int argc, char **argv) } locale_failure: - printf("could not find a UTF8 locale ... please enable en_US.UTF-8\n"); + fprintf(stderr, + "could not find a UTF8 locale ... please enable en_US.UTF-8\n"); return EXIT_FAILURE; locale_success: pclose(fp); -- 2.20.1
3 years, 10 months
3
2
0
0
← Newer
1
Older →
Jump to page:
1
Results per page:
10
25
50
100
200