diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2021-08-27 15:17:29 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2021-08-27 15:17:29 +0000 |
commit | 8797fba30db6f2587753346bee4d1f11c9d5b8ed (patch) | |
tree | b036b7e85f35cfda9c05da3f91fba62895abf98b /src | |
parent | a7b093b0eb1db7dde2463271ee15766df8e584a2 (diff) | |
download | mdevd-8797fba30db6f2587753346bee4d1f11c9d5b8ed.tar.xz |
Support any action type in * and & command directives
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/mdevd/mdevd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mdevd/mdevd.c b/src/mdevd/mdevd.c index a486a9a..6bcdf98 100644 --- a/src/mdevd/mdevd.c +++ b/src/mdevd/mdevd.c @@ -52,6 +52,7 @@ #define ACTION_NONE 0x0 #define ACTION_ADD 0x1 #define ACTION_REMOVE 0x2 +#define ACTION_ANY 0x3 static int dryrun = 0 ; static int cont = 1 ; @@ -823,7 +824,7 @@ static inline int run_scriptelem (struct uevent_s *event, scriptelem const *elem } } - if (action & elem->cmdtype) + if (elem->cmdtype == ACTION_ANY || action == elem->cmdtype) { if (!event_getvar(event, "MDEV")) { @@ -952,7 +953,7 @@ static inline void on_event (struct uevent_s *event, scriptelem const *script, u if (!x) return ; if (!strcmp(x, "add")) action = ACTION_ADD ; else if (!strcmp(x, "remove")) action = ACTION_REMOVE ; - else return ; + else action = ACTION_ANY ; x = event_getvar(event, "DEVPATH") ; if (!x) return ; { |