os: log: drop now meaningless XLOG_FLUSH option
Since we're not indirectly writing via FILE anymore, this option has become meaningless: it meant flushing out our in-process buffer to the kernel, but we're now doing direct write() calls anyways. xf86 still accepts the "flush" config file flag for backwards compatibility, but it hasn't any practical meaning anymore. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
11fc023a72
commit
917d8dc207
|
@ -829,11 +829,9 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
|
||||||
if ((s = xf86GetOptValString(FlagOptions, FLAG_LOG))) {
|
if ((s = xf86GetOptValString(FlagOptions, FLAG_LOG))) {
|
||||||
if (!xf86NameCmp(s, "flush")) {
|
if (!xf86NameCmp(s, "flush")) {
|
||||||
LogMessageVerb(X_CONFIG, 1, "Flushing logfile enabled\n");
|
LogMessageVerb(X_CONFIG, 1, "Flushing logfile enabled\n");
|
||||||
LogSetParameter(XLOG_FLUSH, TRUE);
|
|
||||||
}
|
}
|
||||||
else if (!xf86NameCmp(s, "sync")) {
|
else if (!xf86NameCmp(s, "sync")) {
|
||||||
LogMessageVerb(X_CONFIG, 1, "Syncing logfile enabled\n");
|
LogMessageVerb(X_CONFIG, 1, "Syncing logfile enabled\n");
|
||||||
LogSetParameter(XLOG_FLUSH, TRUE);
|
|
||||||
LogSetParameter(XLOG_SYNC, TRUE);
|
LogSetParameter(XLOG_SYNC, TRUE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -638,7 +638,6 @@ OsVendorInit(void)
|
||||||
g_pszLogFile = LogInit(g_pszLogFile, ".old");
|
g_pszLogFile = LogInit(g_pszLogFile, ".old");
|
||||||
|
|
||||||
}
|
}
|
||||||
LogSetParameter(XLOG_FLUSH, 1);
|
|
||||||
LogSetParameter(XLOG_VERBOSITY, g_iLogVerbose);
|
LogSetParameter(XLOG_VERBOSITY, g_iLogVerbose);
|
||||||
LogSetParameter(XLOG_FILE_VERBOSITY, g_iLogVerbose);
|
LogSetParameter(XLOG_FILE_VERBOSITY, g_iLogVerbose);
|
||||||
|
|
||||||
|
|
|
@ -271,7 +271,6 @@ timingsafe_memcmp(const void *b1, const void *b2, size_t len);
|
||||||
|
|
||||||
/* Logging. */
|
/* Logging. */
|
||||||
typedef enum _LogParameter {
|
typedef enum _LogParameter {
|
||||||
XLOG_FLUSH,
|
|
||||||
XLOG_SYNC,
|
XLOG_SYNC,
|
||||||
XLOG_VERBOSITY,
|
XLOG_VERBOSITY,
|
||||||
XLOG_FILE_VERBOSITY
|
XLOG_FILE_VERBOSITY
|
||||||
|
|
8
os/log.c
8
os/log.c
|
@ -111,7 +111,6 @@ OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
#define DEFAULT_LOG_FILE_VERBOSITY 3
|
#define DEFAULT_LOG_FILE_VERBOSITY 3
|
||||||
|
|
||||||
static int logFileFd = -1;
|
static int logFileFd = -1;
|
||||||
static Bool logFlush = FALSE;
|
|
||||||
static Bool logSync = FALSE;
|
static Bool logSync = FALSE;
|
||||||
static int logVerbosity = DEFAULT_LOG_VERBOSITY;
|
static int logVerbosity = DEFAULT_LOG_VERBOSITY;
|
||||||
static int logFileVerbosity = DEFAULT_LOG_FILE_VERBOSITY;
|
static int logFileVerbosity = DEFAULT_LOG_FILE_VERBOSITY;
|
||||||
|
@ -310,9 +309,6 @@ Bool
|
||||||
LogSetParameter(LogParameter param, int value)
|
LogSetParameter(LogParameter param, int value)
|
||||||
{
|
{
|
||||||
switch (param) {
|
switch (param) {
|
||||||
case XLOG_FLUSH:
|
|
||||||
logFlush = value ? TRUE : FALSE;
|
|
||||||
return TRUE;
|
|
||||||
case XLOG_SYNC:
|
case XLOG_SYNC:
|
||||||
logSync = value ? TRUE : FALSE;
|
logSync = value ? TRUE : FALSE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -561,7 +557,7 @@ LogSWrite(int verb, const char *buf, size_t len, Bool end_line)
|
||||||
if (inSignalContext && logFileFd >= 0) {
|
if (inSignalContext && logFileFd >= 0) {
|
||||||
ret = write(logFileFd, buf, len);
|
ret = write(logFileFd, buf, len);
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
if (logFlush && logSync)
|
if (logSync)
|
||||||
fsync(logFileFd);
|
fsync(logFileFd);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -577,13 +573,11 @@ LogSWrite(int verb, const char *buf, size_t len, Bool end_line)
|
||||||
}
|
}
|
||||||
newline = end_line;
|
newline = end_line;
|
||||||
write(logFileFd, buf, len);
|
write(logFileFd, buf, len);
|
||||||
if (logFlush) {
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
if (logSync)
|
if (logSync)
|
||||||
fsync(logFileFd);
|
fsync(logFileFd);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (!inSignalContext && needBuffer) {
|
else if (!inSignalContext && needBuffer) {
|
||||||
if (len > bufferUnused) {
|
if (len > bufferUnused) {
|
||||||
bufferSize += 1024;
|
bufferSize += 1024;
|
||||||
|
|
Loading…
Reference in New Issue