char *dev_maj_min = path + strlen(path);
char *command = NULL;
char *alias = NULL;
+ int aliaslink;
/* Force the configuration file settings exactly. */
umask(0);
#if ENABLE_FEATURE_MDEV_RENAME
if (!next)
break;
- if (*next == '>') {
+ if (*next == '>' || *next == '=') {
#if ENABLE_FEATURE_MDEV_RENAME_REGEXP
char *s, *p;
unsigned i, n;
+ aliaslink = (*next == '>');
val = next;
next = next_field(val);
/* substitute %1..9 with off[1..9], if any */
s++;
}
#else
+ aliaslink = (*next == '>');
val = next;
next = next_field(val);
alias = xstrdup(val + 1);
}
/* recreate device_name as a symlink to moved device node */
- if (rename(device_name, alias) == 0) {
+ if (rename(device_name, alias) == 0 && aliaslink)
symlink(alias, device_name);
- }
free(alias);
}