summaryrefslogtreecommitdiff
path: root/udev.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-12-12 02:27:50 +0100
committerGreg KH <gregkh@suse.de>2005-04-26 23:13:47 -0700
commit51737eb8b8087d3d9c0cbad8caeaed9efde907fe (patch)
treee05987c0b59fbcb876b84a54ebf14ecdd39f66c9 /udev.c
parent5ce120d366b54ea2bae12ec6ce01bb0d38ff1f50 (diff)
[PATCH] add -V option to udev to print the version number
On Sat, 2004-12-11 at 18:44 +0200, Martin Schlemmer [c] wrote: > > Any suggestions to determining the version of the installed udev? > This is now during startup, to see if we can make use of using > udevsend as hotplug agent. If the system was up, udevinfo could > be used, but that is in /usr/bin that might be on a seperate /usr. > I know we might move udevinfo to /bin, but that might be an issue > for some, and adding a -V switch to /sbin/udev might be a better > choice.
Diffstat (limited to 'udev.c')
-rw-r--r--udev.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/udev.c b/udev.c
index 507f2be943..b1ba1435e7 100644
--- a/udev.c
+++ b/udev.c
@@ -107,8 +107,14 @@ int main(int argc, char *argv[], char *envp[])
const char *devpath = getenv("DEVPATH");
const char *subsystem = argv[1];
- dbg("version %s", UDEV_VERSION);
+ if (argc == 2 && strcmp(argv[1], "-V") == 0) {
+ printf("%s\n", UDEV_VERSION);
+ exit(0);
+ }
+
logging_init("udev");
+ dbg("version %s", UDEV_VERSION);
+
udev_init_config();
/* set signal handlers */