Subject: xsrc/35923: some minor fixes for xfs
To: None <xsrc-manager@netbsd.org, gnats-admin@netbsd.org,>
From: Greg A. Woods <woods@planix.com>
List: netbsd-bugs
Date: 03/05/2007 03:35:00
>Number:         35923
>Category:       xsrc
>Synopsis:       some minor fixes for xfs
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    xsrc-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 05 03:35:00 +0000 2007
>Originator:     Greg A. Woods
>Release:        NetBSD xsrc-current
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Environment:
System: NetBSD
>Description:

	some minor fixes for xfs

>How-To-Repeat:

>Fix:

cvs diff: Diffing xfree/xc/programs/xfs
Index: xfree/xc/programs/xfs/config.cpp
===================================================================
RCS file: /cvs/master/m-NetBSD/main/xsrc/xfree/xc/programs/xfs/config.cpp,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 config.cpp
--- xfree/xc/programs/xfs/config.cpp	9 Jun 2001 15:11:42 -0000	1.1.1.2
+++ xfree/xc/programs/xfs/config.cpp	2 Jul 2004 21:45:28 -0000
@@ -2,12 +2,18 @@
 XCOMM $Xorg: config.cpp,v 1.3 2000/08/17 19:54:19 cpqbld Exp $
 
 clone-self = on
-use-syslog = off
+
+XCOMM use either syslog or the error file, not both
+use-syslog = on
+XCOMM error-file = FSERRORS
+
 catalogue = DEFAULTFONTPATH
-error-file = FSERRORS
+
 XCOMM in decipoints
 default-point-size = 120
-default-resolutions = 75,75,100,100
+
+XCOMM in pixels per inch
+default-resolutions = 100,100,75,75
 
 XCOMM font cache control, specified in KB
 cache-hi-mark = 2048
cvs diff: Diffing xfree/xc/programs/xfs/difs
Index: xfree/xc/programs/xfs/difs/fonts.c
===================================================================
RCS file: /cvs/master/m-NetBSD/main/xsrc/xfree/xc/programs/xfs/difs/fonts.c,v
retrieving revision 1.1.1.6
diff -u -r1.1.1.6 fonts.c
--- xfree/xc/programs/xfs/difs/fonts.c	18 Mar 2005 13:09:27 -0000	1.1.1.6
+++ xfree/xc/programs/xfs/difs/fonts.c	12 Jul 2006 00:28:20 -0000
@@ -85,6 +85,7 @@
     case AllocError:
 	return FSBadAlloc;
     case BadFontName:
+	return FSBadFont;
     case BadFontPath:
 	return FSBadName;
     case BadFontFormat:
cvs diff: Diffing xfree/xc/programs/xfs/include
cvs diff: Diffing xfree/xc/programs/xfs/os
Index: xfree/xc/programs/xfs/os/Imakefile
===================================================================
RCS file: /cvs/master/m-NetBSD/main/xsrc/xfree/xc/programs/xfs/os/Imakefile,v
retrieving revision 1.1.1.6
diff -u -r1.1.1.6 Imakefile
--- xfree/xc/programs/xfs/os/Imakefile	18 Mar 2005 13:09:27 -0000	1.1.1.6
+++ xfree/xc/programs/xfs/os/Imakefile	12 Jul 2006 01:43:59 -0000
@@ -80,7 +80,7 @@
 SNF_DEFINES = -DSNFFORMAT
 #endif
 
-OS_DEFINES = ServerOSDefines
+OS_DEFINES = ServerOSDefines -DDEFAULT_DAEMON
 
 #if BuildFontCacheLib
 FONTCACHE_DEFINES = FontCacheExtensionDefines
Index: xfree/xc/programs/xfs/os/config.c
===================================================================
RCS file: /cvs/master/m-NetBSD/main/xsrc/xfree/xc/programs/xfs/os/config.c,v
retrieving revision 1.1.1.6
diff -u -r1.1.1.6 config.c
--- xfree/xc/programs/xfs/os/config.c	18 Mar 2005 13:09:27 -0000	1.1.1.6
+++ xfree/xc/programs/xfs/os/config.c	12 Jul 2006 00:28:20 -0000
@@ -322,6 +322,42 @@
     return FSSuccess;
 }
 
+char *
+FSstrerror(err)
+    int err;
+{
+    switch (err) {
+    case FSSuccess:
+	return("Success");
+    case FSBadRequest:
+	return("BadRequest");
+    case FSBadFormat:
+	return("BadFormat");
+    case FSBadFont:
+	return("BadFont");
+    case FSBadRange:
+	return("BadRange");
+    case FSBadEventMask:
+	return("BadEventMask");
+    case FSBadAccessContext:
+	return("BadAccessContext");
+    case FSBadIDChoice:
+	return("BadIDChoice");
+    case FSBadName:
+	return("BadName");
+    case FSBadResolution:
+	return("BadResolution");
+    case FSBadAlloc:
+	return("BadAlloc");
+    case FSBadLength:
+	return("BadLength");
+    case FSBadImplementation:
+	return("BadImplementation");
+    default:
+	return("[Unknown FS error]");
+    }
+}
+
 /*
  * handles anything that should be set once the file is parsed
  */
@@ -333,8 +369,8 @@
 
     err = SetFontCatalogue(font_catalogue, &num);
     if (err != FSSuccess) {
-	FatalError("element #%d (starting at 0) of font path is bad or has a bad font:\n\"%s\"\n",
-		   num, font_catalogue);
+	FatalError("Element number %d of font path is bad or has a bad font (Error: %s):\n\"%s\"\n",
+		   num+1, FSstrerror(err), font_catalogue);
     }
     InitErrors();
     fsfree((char *) font_catalogue);
Index: xfree/xc/programs/xfs/os/error.c
===================================================================
RCS file: /cvs/master/m-NetBSD/main/xsrc/xfree/xc/programs/xfs/os/error.c,v
retrieving revision 1.1.1.7
diff -u -r1.1.1.7 error.c
--- xfree/xc/programs/xfs/os/error.c	18 Mar 2005 13:09:27 -0000	1.1.1.7
+++ xfree/xc/programs/xfs/os/error.c	12 Jul 2006 00:28:20 -0000
@@ -92,6 +92,7 @@
 abort_server(void)
 {
     fflush(stderr);
+    CloseErrors();
 
 #ifdef SABER
     saber_stop();