#include <err.h>
#include <string.h>
+#include <syslog.h>
#include "dma.h"
extern int yylineno;
static void
yyerror(const char *msg)
{
- warnx("aliases line %d: %s", yylineno, msg);
+ /**
+ * Because we do error '\n' below, we need to report the error
+ * one line above of what yylineno points to.
+ */
+ syslog(LOG_CRIT, "aliases line %d: %s", yylineno - 1, msg);
+ fprintf(stderr, "aliases line %d: %s\n", yylineno - 1, msg);
}
int
}
| error '\n'
{
- yyerrok;
- $$ = NULL;
+ YYABORT;
}
;