chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
22d097a
)
udev: rules - modernise add_rule a bit
author
Tom Gundersen
<teg@jklm.no>
Fri, 28 Nov 2014 20:44:31 +0000
(21:44 +0100)
committer
Tom Gundersen
<teg@jklm.no>
Fri, 28 Nov 2014 20:54:24 +0000
(21:54 +0100)
src/udev/udev-rules.c
patch
|
blob
|
history
diff --git
a/src/udev/udev-rules.c
b/src/udev/udev-rules.c
index ff2d4ec8504b43c5c92cf44f5e80ab885eadf4e1..a261fbf9780fd843e99e0adbdc5375a9675d0fb0 100644
(file)
--- a/
src/udev/udev-rules.c
+++ b/
src/udev/udev-rules.c
@@
-1042,11
+1042,11
@@
static int add_rule(struct udev_rules *rules, char *line,
const char *filename, unsigned int filename_off, unsigned int lineno) {
char *linepos;
const char *attr;
const char *filename, unsigned int filename_off, unsigned int lineno) {
char *linepos;
const char *attr;
- struct rule_tmp rule_tmp;
+ struct rule_tmp rule_tmp = {
+ .rules = rules,
+ .rule.type = TK_RULE,
+ };
- memzero(&rule_tmp, sizeof(struct rule_tmp));
- rule_tmp.rules = rules;
- rule_tmp.rule.type = TK_RULE;
/* the offset in the rule is limited to unsigned short */
if (filename_off < USHRT_MAX)
rule_tmp.rule.rule.filename_off = filename_off;
/* the offset in the rule is limited to unsigned short */
if (filename_off < USHRT_MAX)
rule_tmp.rule.rule.filename_off = filename_off;