diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-01-18 17:19:18 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-01-18 17:21:52 -0800 |
commit | aa03a3b7f00c9b3697fc5c33b1febf38247450a3 (patch) | |
tree | 5cc7633ae45c1bed4771523e980dbfd4981bc357 | |
parent | 5f875c8a6bc12d47ad655ba820031bb917f321c0 (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.c | 20 | ||||
-rw-r--r-- | utils.h | 3 | ||||
-rw-r--r-- | xkbvleds.c | 1 | ||||
-rw-r--r-- | xkbwatch.c | 1 |
4 files changed, 1 insertions, 24 deletions
@@ -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, ...) @@ -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)) @@ -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, @@ -86,7 +86,6 @@ main(int argc, char *argv[]) } } - uSetErrorFile(NullString); toplevel = XtOpenApplication(&app_con, "XkbWatch", options, XtNumber(options), &argc, argv, fallback_resources, |