diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2021-10-16 06:15:05 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2021-10-16 16:53:40 +0200 |
commit | 2c7d1ce088ba9b588652f58616eb2a8d7748ca88 (patch) | |
tree | ebc970cb55445f6e1e8b0ee50a928d0bea787f7f /util.c | |
parent | 1fd0c9b0e1f27098f9bf86e86285335e640317a5 (diff) | |
download | passt-2c7d1ce088ba9b588652f58616eb2a8d7748ca88.tar passt-2c7d1ce088ba9b588652f58616eb2a8d7748ca88.tar.gz passt-2c7d1ce088ba9b588652f58616eb2a8d7748ca88.tar.bz2 passt-2c7d1ce088ba9b588652f58616eb2a8d7748ca88.tar.lz passt-2c7d1ce088ba9b588652f58616eb2a8d7748ca88.tar.xz passt-2c7d1ce088ba9b588652f58616eb2a8d7748ca88.tar.zst passt-2c7d1ce088ba9b588652f58616eb2a8d7748ca88.zip |
passt: Static builds: don't redefine __vsyslog(), skip getpwnam() and initgroups()
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -37,7 +37,7 @@ #include "util.h" #include "passt.h" -/* For __openlog() and __setlogmask() wrappers, and __vsyslog() (replacement) */ +/* For __openlog() and __setlogmask() wrappers, and passt_vsyslog() */ static int log_mask; static int log_sock = -1; static char log_ident[BUFSIZ]; @@ -56,7 +56,7 @@ void name(const char *format, ...) { \ tp.tv_nsec / (100 * 1000)); \ } else { \ va_start(args, format); \ - __vsyslog(level, format, args); \ + passt_vsyslog(level, format, args); \ va_end(args); \ } \ \ @@ -121,12 +121,12 @@ void __setlogmask(int mask) } /** - * __vsyslog() - vsyslog() implementation not using heap memory + * passt_vsyslog() - vsyslog() implementation not using heap memory * @pri: Facility and level map, same as priority for vsyslog() * @format: Same as vsyslog() format * @ap: Same as vsyslog() ap */ -void __vsyslog(int pri, const char *format, va_list ap) +void passt_vsyslog(int pri, const char *format, va_list ap) { char buf[BUFSIZ]; int n; @@ -389,6 +389,9 @@ char *line_read(char *buf, size_t len, int fd) p = buf + strlen(buf) + 1; + while (*p == '\n' && strlen(p) && (size_t)(p - buf) < len) + p++; + if (!(nl = strchr(p, '\n'))) return NULL; *nl = 0; |