Module Name: xsrc Committed By: tsutsui Date: Tue Aug 4 14:34:35 UTC 2020
Modified Files: xsrc/external/mit/xorg-server.old/dist/hw/sun: sunInit.c sunIo.c Log Message: Sync with xorg-server: > Call LogInit() for logging to /var/log/Xsun.%s.log as Xorg server. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ xsrc/external/mit/xorg-server.old/dist/hw/sun/sunInit.c cvs rdiff -u -r1.1 -r1.2 \ xsrc/external/mit/xorg-server.old/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.old/dist/hw/sun/sunInit.c diff -u xsrc/external/mit/xorg-server.old/dist/hw/sun/sunInit.c:1.2 xsrc/external/mit/xorg-server.old/dist/hw/sun/sunInit.c:1.3 --- xsrc/external/mit/xorg-server.old/dist/hw/sun/sunInit.c:1.2 Sat Aug 1 13:40:55 2020 +++ xsrc/external/mit/xorg-server.old/dist/hw/sun/sunInit.c Tue Aug 4 14:34:35 2020 @@ -51,6 +51,14 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #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 @@ OsVendorInit(void) { static int inited; if (!inited) { + const char *logfile; + char *lf; #ifndef i386 struct rlimit rl; @@ -496,6 +506,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.old/dist/hw/sun/sunIo.c diff -u xsrc/external/mit/xorg-server.old/dist/hw/sun/sunIo.c:1.1 xsrc/external/mit/xorg-server.old/dist/hw/sun/sunIo.c:1.2 --- xsrc/external/mit/xorg-server.old/dist/hw/sun/sunIo.c:1.1 Wed Jul 22 19:17:04 2020 +++ xsrc/external/mit/xorg-server.old/dist/hw/sun/sunIo.c Tue Aug 4 14:34:35 2020 @@ -186,6 +186,7 @@ AbortDDX(void) sunDisableCursor (pScreen); #endif } + LogClose(); } /* Called by GiveUp(). */