summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Weigelt, metux IT consult <info@metux.net>2024-02-27 17:14:47 +0100
committerMarge Bot <emma+marge@anholt.net>2024-07-26 22:26:07 +0000
commit96c99b83183c889e499edb8535c7b9e9025fe11a (patch)
treee47d74cf3af6c802808cf8bcc3aa7342d26eb8cb
parent749046e5e9f04b6b2fce95233904cccf83e31d0e (diff)
os: move -nolock help message printing to serverlock.h
Reduce #ifdef cluttering in os/utils.c a little bit my moving the (built-time-) conditional printing of the help message into serverlock.c Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1320>
-rw-r--r--os/serverlock.c5
-rw-r--r--os/serverlock.h1
-rw-r--r--os/utils.c4
3 files changed, 7 insertions, 3 deletions
diff --git a/os/serverlock.c b/os/serverlock.c
index f5c03e32f..36efc9bc0 100644
--- a/os/serverlock.c
+++ b/os/serverlock.c
@@ -239,10 +239,15 @@ void DisableServerLock(void) {
nolock = TRUE;
}
+void LockServerUseMsg(void) {
+ ErrorF("-nolock disable the locking mechanism\n");
+}
+
#else /* LOCK_SERVER */
void LockServer(void) {}
void UnlockServer(void) {}
void DisableServerLock(void) {}
+void LockServerUseMsg(void) {}
#endif /* LOCK_SERVER */
diff --git a/os/serverlock.h b/os/serverlock.h
index ec74c2bb2..dae1cf2a4 100644
--- a/os/serverlock.h
+++ b/os/serverlock.h
@@ -8,5 +8,6 @@
void LockServer(void);
void UnlockServer(void);
void DisableServerLock(void);
+void LockServerUseMsg(void);
#endif /* _XSERVER_SERVERLOCK_H */
diff --git a/os/utils.c b/os/utils.c
index ded9a463e..ebd3ece60 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -371,9 +371,7 @@ UseMsg(void)
#ifdef RLIMIT_STACK
ErrorF("-ls int limit stack space to N Kb\n");
#endif
-#ifdef LOCK_SERVER
- ErrorF("-nolock disable the locking mechanism\n");
-#endif
+ LockServerUseMsg();
ErrorF("-maxclients n set maximum number of clients (power of two)\n");
ErrorF("-nolisten string don't listen on protocol\n");
ErrorF("-listen string listen on protocol\n");