From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthias Schwarzott Date: Thu, 22 Feb 2007 16:18:33 +0000 Subject: [PATCH] Add option --version to udevd Message-Id: <200702221718.33357.zzam@gentoo.org> MIME-Version: 1 Content-Type: multipart/mixed; boundary="Boundary-00=_ZJc3F1MTGWiHV9h" List-Id: To: linux-hotplug@vger.kernel.org --Boundary-00=_ZJc3F1MTGWiHV9h Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi! This small patch adds the option --version to udevd to just print out UDEV_VERSION. Sometimes the udev-startskript needs to know the udev-version (or needed in the past) and udevd at least is garanteed to exit even if /usr is not yet mounted. Some versions ago the executable udev had that option, but as that was removed possibilities are either to add --version to some other executable, or to hardcode udev-version into udev-startskript at every upgrade. Greetings Matthias -- Matthias Schwarzott (zzam) --Boundary-00=_ZJc3F1MTGWiHV9h Content-Type: text/x-diff; charset="utf-8"; name="udevd-print-version.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="udevd-print-version.patch" diff --git a/udevd.c b/udevd.c index 8c550d3..23f5fd6 100644 --- a/udevd.c +++ b/udevd.c @@ -943,6 +943,7 @@ int main(int argc, char *argv[], char *envp[]) { "debug-trace", 0, NULL, 't' }, { "verbose", 0, NULL, 'v' }, { "help", 0, NULL, 'h' }, + { "version", 0, NULL, 'V' }, {} }; int rc = 1; @@ -955,7 +956,7 @@ int main(int argc, char *argv[], char *envp[]) /* parse commandline options */ while (1) { - option = getopt_long(argc, argv, "dtvh", options, NULL); + option = getopt_long(argc, argv, "dtvhV", options, NULL); if (option == -1) break; @@ -972,7 +973,10 @@ int main(int argc, char *argv[], char *envp[]) udev_log_priority = LOG_INFO; break; case 'h': - printf("Usage: udevd [--help] [--daemon] [--debug-trace] [--verbose]\n"); + printf("Usage: udevd [--help] [--daemon] [--debug-trace] [--verbose] [--version]\n"); + goto exit; + case 'V': + printf("%s\n", UDEV_VERSION); goto exit; default: goto exit; --Boundary-00=_ZJc3F1MTGWiHV9h Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV --Boundary-00=_ZJc3F1MTGWiHV9h Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel --Boundary-00=_ZJc3F1MTGWiHV9h--