Module Name: xsrc
Committed By: tsutsui
Date: Tue Aug 4 14:31:04 UTC 2020
Modified Files:
xsrc/external/mit/xorg-server/dist/hw/sun: sunInit.c sunIo.c
Log Message:
Call LogInit() for logging to /var/log/Xsun.%s.log as Xorg server.
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/xorg-server/dist/hw/sun/sunInit.c
cvs rdiff -u -r1.1 -r1.2 xsrc/external/mit/xorg-server/dist/hw/sun/sunIo.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: xsrc/external/mit/xorg-server/dist/hw/sun/sunInit.c
diff -u xsrc/external/mit/xorg-server/dist/hw/sun/sunInit.c:1.3 xsrc/external/mit/xorg-server/dist/hw/sun/sunInit.c:1.4
--- xsrc/external/mit/xorg-server/dist/hw/sun/sunInit.c:1.3 Thu Jul 30 14:32:52 2020
+++ xsrc/external/mit/xorg-server/dist/hw/sun/sunInit.c Tue Aug 4 14:31:04 2020
@@ -52,6 +52,14 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "fb.h"
#include "extinit.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
@@ -481,6 +489,8 @@ OsVendorInit(void)
{
static int inited;
if (!inited) {
+ const char *logfile;
+ char *lf;
#ifndef i386
struct rlimit rl;
@@ -495,6 +505,20 @@ OsVendorInit(void)
(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);
Index: xsrc/external/mit/xorg-server/dist/hw/sun/sunIo.c
diff -u xsrc/external/mit/xorg-server/dist/hw/sun/sunIo.c:1.1 xsrc/external/mit/xorg-server/dist/hw/sun/sunIo.c:1.2
--- xsrc/external/mit/xorg-server/dist/hw/sun/sunIo.c:1.1 Wed Jul 22 20:38:29 2020
+++ xsrc/external/mit/xorg-server/dist/hw/sun/sunIo.c Tue Aug 4 14:31:04 2020
@@ -186,6 +186,7 @@ AbortDDX(enum ExitCode error)
sunDisableCursor (pScreen);
#endif
}
+ LogClose(error);
}
/* Called by GiveUp(). */