summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2024-01-18 17:19:18 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2024-01-18 17:21:52 -0800
commitaa03a3b7f00c9b3697fc5c33b1febf38247450a3 (patch)
tree5cc7633ae45c1bed4771523e980dbfd4981bc357
parent5f875c8a6bc12d47ad655ba820031bb917f321c0 (diff)
Remove uSetErrorFile()
It was only ever called with an argument of NullString, which set the errorFile to stderr, so we'll just do that at compile time instead. Also removes NullString, which was only ever used in uSetErrorFile. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--utils.c20
-rw-r--r--utils.h3
-rw-r--r--xkbvleds.c1
-rw-r--r--xkbwatch.c1
4 files changed, 1 insertions, 24 deletions
diff --git a/utils.c b/utils.c
index a931e75..6a1f432 100644
--- a/utils.c
+++ b/utils.c
@@ -33,25 +33,7 @@
/*** PRINT FUNCTIONS ***/
/***====================================================================***/
-static FILE *errorFile = NULL;
-
-Boolean
-uSetErrorFile(const char *name)
-{
- if ((errorFile != NULL) && (errorFile != stderr)) {
- fprintf(errorFile, "switching to %s\n", name ? name : "stderr");
- fclose(errorFile);
- }
- if (name != NullString)
- errorFile = fopen(name, "w");
- else
- errorFile = stderr;
- if (errorFile == NULL) {
- errorFile = stderr;
- return (False);
- }
- return (True);
-}
+#define errorFile stderr
void
uInformation(const char *s, ...)
diff --git a/utils.h b/utils.h
index 370311b..a79019d 100644
--- a/utils.h
+++ b/utils.h
@@ -55,7 +55,6 @@ typedef char Boolean;
/***====================================================================***/
-extern Boolean uSetErrorFile(const char *name);
extern void uInformation(const char *s, ...) _X_ATTRIBUTE_PRINTF(1,2);
extern void uAction(const char *s, ...) _X_ATTRIBUTE_PRINTF(1,2);
extern void uWarning(const char *s, ...) _X_ATTRIBUTE_PRINTF(1,2);
@@ -65,8 +64,6 @@ extern void uInternalError(const char *s, ...) _X_ATTRIBUTE_PRINTF(1,2);
/***====================================================================***/
-#define NullString ((char *)NULL)
-
#define uStrCaseEqual(s1,s2) (uStrCaseCmp(s1,s2)==0)
#ifdef HAVE_STRCASECMP
#define uStrCaseCmp(s1,s2) (strcasecmp(s1,s2))
diff --git a/xkbvleds.c b/xkbvleds.c
index 7d59fba..03745fb 100644
--- a/xkbvleds.c
+++ b/xkbvleds.c
@@ -215,7 +215,6 @@ main(int argc, char *argv[])
NULL
};
- uSetErrorFile(NullString);
bzero(leds, XkbNumIndicators * sizeof(Widget));
toplevel = XtOpenApplication(&app_con, "XkbLEDPanel", NULL, 0, &argc, argv,
fallback_resources,
diff --git a/xkbwatch.c b/xkbwatch.c
index 583e222..4a71d28 100644
--- a/xkbwatch.c
+++ b/xkbwatch.c
@@ -86,7 +86,6 @@ main(int argc, char *argv[])
}
}
- uSetErrorFile(NullString);
toplevel = XtOpenApplication(&app_con, "XkbWatch",
options, XtNumber(options), &argc, argv,
fallback_resources,