summaryrefslogtreecommitdiff
path: root/lib/zlog.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@users.noreply.github.com>2020-07-24 14:53:28 -0400
committerGitHub <noreply@github.com>2020-07-24 14:53:28 -0400
commit6df9625212b4d7dd287122bf32f2ee76b6555fa0 (patch)
tree300f77908bbbdf7a9d11f1984faccda0d334c4fa /lib/zlog.c
parentd2b4eeb1fb779c6249912843c6485d940d32b357 (diff)
parent6a3b431b85088d2d76a14d6c22ee85bdc5465c8c (diff)
Merge pull request #6771 from opensourcerouting/netbsd-tls-buf
lib: fix TLS log buffer on NetBSD
Diffstat (limited to 'lib/zlog.c')
-rw-r--r--lib/zlog.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/zlog.c b/lib/zlog.c
index 45726755f8..8dfd20371b 100644
--- a/lib/zlog.c
+++ b/lib/zlog.c
@@ -246,10 +246,10 @@ void zlog_tls_buffer_init(void)
fchown(mmfd, zlog_uid, zlog_gid);
#ifdef HAVE_POSIX_FALLOCATE
- if (posix_fallocate(mmfd, 0, TLS_LOG_BUF_SIZE) < 0) {
-#else
- if (ftruncate(mmfd, TLS_LOG_BUF_SIZE) < 0) {
+ if (posix_fallocate(mmfd, 0, TLS_LOG_BUF_SIZE) != 0)
+ /* note next statement is under above if() */
#endif
+ if (ftruncate(mmfd, TLS_LOG_BUF_SIZE) < 0) {
zlog_err("failed to allocate thread log buffer \"%s\": %s",
mmpath, strerror(errno));
goto out_anon_unlink;