diff options
author | 2012-04-17 09:34:15 +0000 | |
---|---|---|
committer | 2012-04-17 09:34:15 +0000 | |
commit | acf47a9567921ddb4e2cc636192293a8103b763e (patch) | |
tree | 0d1b681ba5fa0b08405ad40b68bcdade6f3aed3c | |
parent | Add sgi_cpuspeed() setting HW_CPUSPEED sysctl node. Tested on SGI Fuel. (diff) | |
download | wireguard-openbsd-acf47a9567921ddb4e2cc636192293a8103b763e.tar.xz wireguard-openbsd-acf47a9567921ddb4e2cc636192293a8103b763e.zip |
this error message was impossible to understand without the source code.
be slightly more verbose and really explain what's going on.
okay millert@
-rw-r--r-- | usr.bin/make/parse.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index 72fc76e475d..d5f102dfe33 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.102 2012/04/11 18:27:30 espie Exp $ */ +/* $OpenBSD: parse.c,v 1.103 2012/04/17 09:34:15 espie Exp $ */ /* $NetBSD: parse.c,v 1.29 1997/03/10 21:20:04 christos Exp $ */ /* @@ -279,6 +279,28 @@ ParseLinkSrc(GNode *pgn, GNode *cgn) } } +static char * +operator_string(int op) +{ + /* XXX we don't bother freeing this, it's used for a fatal error + * anyways + */ + char *result = emalloc(5); + char *t = result; + if (op & OP_DEPENDS) { + *t++ = ':'; + } + if (op & OP_FORCE) { + *t++ = '!'; + } + if (op & OP_DOUBLEDEP) { + *t++ = ':'; + *t++ = ':'; + } + *t = 0; + return result; +} + /*- *--------------------------------------------------------------------- * ParseDoOp -- @@ -303,8 +325,11 @@ ParseDoOp(GNode **gnp, unsigned int op) */ if (((op & OP_OPMASK) != (gn->type & OP_OPMASK)) && !OP_NOP(gn->type) && !OP_NOP(op)) { - Parse_Error(PARSE_FATAL, "Inconsistent operator for %s", - gn->name); + Parse_Error(PARSE_FATAL, + "Inconsistent dependency operator for target %s\n" + "\t(was %s%s, now %s%s)", + gn->name, gn->name, operator_string(op), + gn->name, operator_string(gn->type)); return 0; } |