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:
parent
33fa580900
commit
f24f0e5864
|
@ -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
|
@ -109,8 +109,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;
|
||||
|
||||
|
|
|
@ -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 */
|
Loading…
Reference in New Issue