Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[xsrc/trunk]: xsrc/external/mit/xorg-server.old/dist/hw/sun Sync with xorg-se...
details: https://anonhg.NetBSD.org/xsrc/rev/05f20ebdc376
branches: trunk
changeset: 10532:05f20ebdc376
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Tue Aug 04 14:34:35 2020 +0000
description:
Sync with xorg-server:
> Call LogInit() for logging to /var/log/Xsun.%s.log as Xorg server.
diffstat:
external/mit/xorg-server.old/dist/hw/sun/sunInit.c | 24 ++++++++++++++++++++++
external/mit/xorg-server.old/dist/hw/sun/sunIo.c | 1 +
2 files changed, 25 insertions(+), 0 deletions(-)
diffs (59 lines):
diff -r e6fc6a80ba4b -r 05f20ebdc376 external/mit/xorg-server.old/dist/hw/sun/sunInit.c
--- a/external/mit/xorg-server.old/dist/hw/sun/sunInit.c Tue Aug 04 14:31:04 2020 +0000
+++ b/external/mit/xorg-server.old/dist/hw/sun/sunInit.c Tue Aug 04 14:34:35 2020 +0000
@@ -51,6 +51,14 @@
#include "mi.h"
#include "fb.h"
+/* default log file paths */
+#ifndef DEFAULT_LOGDIR
+#define DEFAULT_LOGDIR "/var/log"
+#endif
+#ifndef DEFAULT_LOGPREFIX
+#define DEFAULT_LOGPREFIX "Xsun."
+#endif
+
/* maximum pixmap depth */
#ifndef SUNMAXDEPTH
#define SUNMAXDEPTH 8
@@ -482,6 +490,8 @@
{
static int inited;
if (!inited) {
+ const char *logfile;
+ char *lf;
#ifndef i386
struct rlimit rl;
@@ -496,6 +506,20 @@
(void) setrlimit (RLIMIT_NOFILE, &rl);
}
#endif
+
+#define LOGSUFFIX ".log"
+#define LOGOLDSUFFIX ".old"
+
+ logfile = DEFAULT_LOGDIR "/" DEFAULT_LOGPREFIX;
+ if (asprintf(&lf, "%s%%s" LOGSUFFIX, logfile) == -1)
+ FatalError("Cannot allocate space for the log file name\n");
+ LogInit(lf, LOGOLDSUFFIX);
+
+#undef LOGSUFFIX
+#undef LOGOLDSUFFIX
+
+ free(lf);
+
sunKbdPriv.fd = open ("/dev/kbd", O_RDWR, 0);
if (sunKbdPriv.fd < 0)
FatalError ("Cannot open /dev/kbd, error %d\n", errno);
diff -r e6fc6a80ba4b -r 05f20ebdc376 external/mit/xorg-server.old/dist/hw/sun/sunIo.c
--- a/external/mit/xorg-server.old/dist/hw/sun/sunIo.c Tue Aug 04 14:31:04 2020 +0000
+++ b/external/mit/xorg-server.old/dist/hw/sun/sunIo.c Tue Aug 04 14:34:35 2020 +0000
@@ -186,6 +186,7 @@
sunDisableCursor (pScreen);
#endif
}
+ LogClose();
}
/* Called by GiveUp(). */
Home |
Main Index |
Thread Index |
Old Index