]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udevadm: trigger: support multiple arguments 11478/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 18 Jan 2019 08:09:18 +0000 (17:09 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 23 Jan 2019 06:22:16 +0000 (15:22 +0900)
Closes #6098.

man/udevadm.xml
src/udev/udevadm-trigger.c

index b7a2494f83a63b9c968d10338fb85694498fd0b0..0107c575762dfef211fbba88508a4fe5244732d7 100644 (file)
       </title>
       <para>Request device events from the kernel. Primarily used to replay events at system coldplug time.</para>
 
-      <para>Takes a device specification as a positional argument. See the description of <command>info</command>
+      <para>Takes device specifications as positional arguments. See the description of <command>info</command>
       above.</para>
 
       <variablelist>
           <term><option>--name-match=<replaceable>NAME</replaceable></option></term>
           <listitem>
             <para>Trigger events for devices with a matching device path. When this option is specified more than once,
-            the last <replaceable>NAME</replaceable> is used.</para>
+            then each matching result is ORed, that is, all specified devices are triggered.</para>
           </listitem>
         </varlistentry>
         <varlistentry>
           <term><option>--parent-match=<replaceable>SYSPATH</replaceable></option></term>
           <listitem>
             <para>Trigger events for all children of a given device. When this option is specified more than once,
-            the last <replaceable>NAME</replaceable> is used.</para>
+            then each matching result is ORed, that is, all children of each specified device are triggered.</para>
           </listitem>
         </varlistentry>
         <varlistentry>
         <xi:include href="standard-options.xml" xpointer="help" />
       </variablelist>
 
-      <para>In addition, an optional positional argument can be used
-      to specify device name or sys path. It must start with
+      <para>In addition, optional positional arguments can be used
+      to specify device names or sys paths. They must start with
       <filename>/dev</filename> or <filename>/sys</filename>
       respectively.</para>
     </refsect2>
index 95329469e3899e0e7eded46de0b278f7ab25c7b9..2a658158e61d0533919e97908d1cb78e50d51678 100644 (file)
@@ -256,7 +256,7 @@ int trigger_main(int argc, char *argv[], void *userdata) {
                         if (r < 0)
                                 return log_error_errno(r, "Failed to open the device '%s': %m", optarg);
 
-                        r = sd_device_enumerator_add_match_parent(e, dev);
+                        r = device_enumerator_add_match_parent_incremental(e, dev);
                         if (r < 0)
                                 return log_error_errno(r, "Failed to add parent match '%s': %m", optarg);
                         break;
@@ -272,7 +272,7 @@ int trigger_main(int argc, char *argv[], void *userdata) {
                         if (r < 0)
                                 return log_error_errno(r, "Failed to open the device '%s': %m", optarg);
 
-                        r = sd_device_enumerator_add_match_parent(e, dev);
+                        r = device_enumerator_add_match_parent_incremental(e, dev);
                         if (r < 0)
                                 return log_error_errno(r, "Failed to add parent match '%s': %m", optarg);
                         break;
@@ -324,7 +324,7 @@ int trigger_main(int argc, char *argv[], void *userdata) {
                 if (r < 0)
                         return log_error_errno(r, "Failed to open the device '%s': %m", argv[optind]);
 
-                r = sd_device_enumerator_add_match_parent(e, dev);
+                r = device_enumerator_add_match_parent_incremental(e, dev);
                 if (r < 0)
                         return log_error_errno(r, "Failed to add parent match '%s': %m", argv[optind]);
         }