mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-28 14:19:17 +00:00
os: direct access to logSync instead of complex LogSetParameter()
It's just a simple flag, and only written from one site, so no need for complex 'generic' setter function. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt, metux IT consult .
parent
74ccb158eb
commit
4fa8b1658b
@@ -50,6 +50,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <grp.h>
|
||||
|
||||
#include "os/log_priv.h"
|
||||
#include "os/osdep.h"
|
||||
|
||||
#include "xf86.h"
|
||||
@@ -831,7 +832,7 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
|
||||
}
|
||||
else if (!xf86NameCmp(s, "sync")) {
|
||||
LogMessageVerb(X_CONFIG, 1, "Syncing logfile enabled\n");
|
||||
LogSetParameter(XLOG_SYNC, TRUE);
|
||||
logSync = TRUE;
|
||||
}
|
||||
else {
|
||||
LogMessageVerb(X_WARNING, 1, "Unknown Log option\n");
|
||||
|
||||
3
os/log.c
3
os/log.c
@@ -110,8 +110,9 @@ OR PERFORMANCE OF THIS SOFTWARE.
|
||||
#define DEFAULT_LOG_VERBOSITY 0
|
||||
#define DEFAULT_LOG_FILE_VERBOSITY 3
|
||||
|
||||
Bool logSync = FALSE;
|
||||
|
||||
static int logFileFd = -1;
|
||||
static Bool logSync = FALSE;
|
||||
static int logVerbosity = DEFAULT_LOG_VERBOSITY;
|
||||
static int logFileVerbosity = DEFAULT_LOG_FILE_VERBOSITY;
|
||||
|
||||
|
||||
18
os/log_priv.h
Normal file
18
os/log_priv.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/* SPDX-License-Identifier: MIT OR X11
|
||||
*
|
||||
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
|
||||
*/
|
||||
#ifndef _XSERVER_LOG_PRIV_H
|
||||
#define _XSERVER_LOG_PRIV_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <X11/Xdefs.h>
|
||||
|
||||
/**
|
||||
* @brief force fsync() on each log write
|
||||
*
|
||||
* If set to TRUE, force fsync() on each log write.
|
||||
*/
|
||||
extern Bool logSync;
|
||||
|
||||
#endif /* _XSERVER_LOG_PRIV_H */
|
||||
Reference in New Issue
Block a user