aboutsummaryrefslogtreecommitdiff
path: root/util-linux/mdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux/mdev.c')
-rw-r--r--util-linux/mdev.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/util-linux/mdev.c b/util-linux/mdev.c
index c6be1b872..67de52d06 100644
--- a/util-linux/mdev.c
+++ b/util-linux/mdev.c
@@ -206,7 +206,8 @@ static void parse_next_rule(void)
206 char *tokens[4]; 206 char *tokens[4];
207 char *val; 207 char *val;
208 208
209 if (!config_read(G.parser, tokens, 4, 3, "# \t", PARSE_NORMAL)) 209 /* No PARSE_EOL_COMMENTS, because command may contain '#' chars */
210 if (!config_read(G.parser, tokens, 4, 3, "# \t", PARSE_NORMAL & ~PARSE_EOL_COMMENTS))
210 break; 211 break;
211 212
212 /* Fields: [-]regex uid:gid mode [alias] [cmd] */ 213 /* Fields: [-]regex uid:gid mode [alias] [cmd] */
@@ -564,8 +565,12 @@ static void make_device(char *path, int delete)
564 chown(node_name, rule->ugid.uid, rule->ugid.gid); 565 chown(node_name, rule->ugid.uid, rule->ugid.gid);
565 } 566 }
566 if (ENABLE_FEATURE_MDEV_RENAME && alias) { 567 if (ENABLE_FEATURE_MDEV_RENAME && alias) {
567 if (aliaslink == '>') 568 if (aliaslink == '>') {
569//TODO: on devtmpfs, device_name already exists and symlink() fails.
570//End result is that instead of symlink, we have two nodes.
571//What should be done?
568 symlink(node_name, device_name); 572 symlink(node_name, device_name);
573 }
569 } 574 }
570 } 575 }
571 576
@@ -782,7 +787,7 @@ int mdev_main(int argc UNUSED_PARAM, char **argv)
782 int seqlen; 787 int seqlen;
783 char seqbuf[sizeof(int)*3 + 2]; 788 char seqbuf[sizeof(int)*3 + 2];
784 789
785 seqlen = open_read_close("mdev.seq", seqbuf, sizeof(seqbuf-1)); 790 seqlen = open_read_close("mdev.seq", seqbuf, sizeof(seqbuf) - 1);
786 if (seqlen < 0) { 791 if (seqlen < 0) {
787 seq = NULL; 792 seq = NULL;
788 break; 793 break;