diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2018-01-15 03:45:27 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2018-01-15 03:45:27 +0000 |
commit | 3acfabcd1ae55e864601a6ce321bc3830cd57ddd (patch) | |
tree | 8dab1411f3d95028b919deeb49b47d204cd2e9c7 /src | |
parent | 8eff37b20833b3d5b0e5c98de78f253bded5131c (diff) | |
download | mdevd-3acfabcd1ae55e864601a6ce321bc3830cd57ddd.tar.xz |
Don't add the MDEV envvar more than once
Diffstat (limited to 'src')
-rw-r--r-- | src/mdevd/mdevd.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mdevd/mdevd.c b/src/mdevd/mdevd.c index 162a6f5..ed83384 100644 --- a/src/mdevd/mdevd.c +++ b/src/mdevd/mdevd.c @@ -803,9 +803,12 @@ static inline int run_scriptelem (struct uevent_s *event, scriptelem const *elem if (action & elem->cmdtype) { - event->vars[event->varn++] = event->len ; - memcpy(event->buf + event->len, "MDEV=", 5) ; - event->len += 6 + nodelen ; + if (!event_getvar(event, "MDEV")) + { + event->vars[event->varn++] = event->len ; + memcpy(event->buf + event->len, "MDEV=", 5) ; + event->len += 6 + nodelen ; + } if (dryrun) { strerr_warni2x("dry run: spawn ", storage + elem->command) ; |