summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2003-04-21 04:00:01 +0000
committerimp <imp@FreeBSD.org>2003-04-21 04:00:01 +0000
commit304876f035aec43b1760b405c77a7f294b73ca0d (patch)
tree8d09b79ec491549cee50d32faf6772959f859f0c /sbin
parent3cce5fea028cce36184ccd2bfa5ac90cf3f30465 (diff)
downloadFreeBSD-src-304876f035aec43b1760b405c77a7f294b73ca0d.zip
FreeBSD-src-304876f035aec43b1760b405c77a7f294b73ca0d.tar.gz
o Skip white space between variables better. This makes
'a="b" c="d" at loc=1 on busN' properly set 'c' and process the rest of the stirng. Before it would ignore everything after variable 'a'. o Parse nomatch and other events differently. They are more different than the code allowed for, so we weren't properly parsing nomatch events. It appears this fixes some of the demand loading issues that I was having with devd. Noticed by: Gary Palmer
Diffstat (limited to 'sbin')
-rw-r--r--sbin/devd/devd.cc23
1 files changed, 17 insertions, 6 deletions
diff --git a/sbin/devd/devd.cc b/sbin/devd/devd.cc
index 7ddd726..9a0ea0e 100644
--- a/sbin/devd/devd.cc
+++ b/sbin/devd/devd.cc
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2002 M. Warner Losh.
+ * Copyright (c) 2002-2003 M. Warner Losh.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -572,6 +572,8 @@ config::chop_var(char *&buffer, char *&lhs, char *&rhs)
*walker++ = '\0';
rhs[-1] = '\0';
}
+ while (isspace(*walker))
+ walker++;
buffer = walker;
return (true);
}
@@ -645,12 +647,21 @@ process_event(char *buffer)
return; /* Can't happen? */
*sp++ = '\0';
cfg.set_variable("device-name", buffer);
+ if (strncmp(sp, "at ", 3) == 0)
+ sp += 3;
+ sp = cfg.set_vars(sp);
+ if (strncmp(sp, "on ", 3) == 0)
+ cfg.set_variable("bus", sp + 3);
+ } else {
+ //?vars at location on bus
+ sp = cfg.set_vars(sp);
+ if (strncmp(sp, "at ", 3) == 0)
+ sp += 3;
+ sp = cfg.set_vars(sp);
+ if (strncmp(sp, "on ", 3) == 0)
+ cfg.set_variable("bus", sp + 3);
}
- if (strncmp(sp, "at ", 3) == 0)
- sp += 3;
- sp = cfg.set_vars(sp);
- if (strncmp(sp, "on ", 3) == 0)
- cfg.set_variable("bus", sp + 3);
+
cfg.find_and_execute(type);
cfg.pop_var_table();
}
OpenPOWER on IntegriCloud