1 --- fmtmsg.c 2004-04-15 15:49:49.000000000 -0700
2 +++ ../../../test/fmtmsg.c 2005-03-02 10:53:07.000000000 -0800
7 +#include <sys/types.h>
10 /* Default value for MSGVERB. */
11 #define DFLT_MSGVERB "label:severity:text:action:tag"
15 char *env, *msgverb, *output;
18 + if (action == NULL) action = "";
20 if (class & MM_PRINT) {
21 if ((env = getenv("MSGVERB")) != NULL && *env != '\0' &&
26 - if (*output != '\0')
27 - fprintf(stderr, "%s", output);
28 + if (*output != '\0') {
29 + int out_len = fprintf(stderr, "%s", output);
40 if (*output != '\0') {
41 - if ((fp = fopen("/dev/console", "a")) == NULL) {
63 +// DO NOT INTEGRATE THIS CHANGE
65 +// Integrating it means DEATH.
66 +// (see Revelation 6:8 for full details)
68 + XXX this is a *huge* kludge to pass the SuSv3 tests,
69 + I don't think of it as cheating because they are
70 + looking in the wrong place (/realdev/console) to do
71 + their testing, but they can't look in the "right"
72 + place for various reasons */
73 + char *cpath = "/dev/console";
75 + int rc = stat("/realdev/console", &sb);
76 + if (rc == 0 && (sb.st_mode & S_IFDIR)) {
77 + cpath = "/realdev/console";
79 + /* XXX thus ends the kludge - changes after
80 + this point may be safely integrated */
82 + if ((fp = fopen(cpath, "a")) == NULL) {
89 + fprintf(fp, "%s", output);
92 - fprintf(fp, "%s", output);
101 #define INSERT_COLON \