From 3acfabcd1ae55e864601a6ce321bc3830cd57ddd Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 15 Jan 2018 03:45:27 +0000 Subject: Don't add the MDEV envvar more than once --- src/mdevd/mdevd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') 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) ; -- cgit v1.2.3