From: Matthias Schwarzott <zzam@gentoo.org>
To: linux-hotplug@vger.kernel.org
Subject: [PATCH] Add option --version to udevd
Date: Thu, 22 Feb 2007 16:18:33 +0000 [thread overview]
Message-ID: <200702221718.33357.zzam@gentoo.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 521 bytes --]
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)
[-- Attachment #2: udevd-print-version.patch --]
[-- Type: text/x-diff, Size: 981 bytes --]
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;
[-- Attachment #3: Type: text/plain, Size: 345 bytes --]
-------------------------------------------------------------------------
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
[-- Attachment #4: Type: text/plain, Size: 226 bytes --]
_______________________________________________
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
next reply other threads:[~2007-02-22 16:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-22 16:18 Matthias Schwarzott [this message]
2007-02-24 23:00 ` [PATCH] Add option --version to udevd Kay Sievers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200702221718.33357.zzam@gentoo.org \
--to=zzam@gentoo.org \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).