[master] 67bc0aee4 mgt: Typo in pthread.h (un)safety net
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Fri Jun 20 08:07:07 UTC 2025
commit 67bc0aee4b0531350217e438886b8730c6805c16
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date: Fri Jun 20 10:04:33 2025 +0200
mgt: Typo in pthread.h (un)safety net
I was trying to add a safety net to catch pthread usage in MGT code and
eventually ran into this. Unfortunately, it didn't catch the pthread.h
inclusion from #4231, because it happened in a header file included
after mgt.h and in general we should avoid including anything from
header files, letting C files include everything needed.
This is at least the model for functions like getaddrinfo(): netdb.h
does not include sys/types.h and sys/socket.h on our behalf.
I'm not sure how to formalize this check beyond a rule to remember
during code reviews. I said in #4346 that I'd like to add a build-time
check but it already exists and for now the only way to uphold it is
discipline.
diff --git a/bin/varnishd/mgt/mgt.h b/bin/varnishd/mgt/mgt.h
index 2610aaf75..b99b96e22 100644
--- a/bin/varnishd/mgt/mgt.h
+++ b/bin/varnishd/mgt/mgt.h
@@ -248,7 +248,7 @@ extern const char *mgt_vcl_path;
extern const char *mgt_vmod_path;
#if defined(PTHREAD_CANCELED) || defined(PTHREAD_MUTEX_DEFAULT)
-#error "Keep pthreads out of in manager process"
+#error "Keep pthreads out of the manager process"
#endif
#define MGT_FEATURE(x) COM_FEATURE(mgt_param.feature_bits, x)
More information about the varnish-commit
mailing list