udev: use version()

Fixes #27382.
This commit is contained in:
Yu Watanabe
2023-04-25 19:52:26 +09:00
committed by Daan De Meyer
parent fa84c1ce00
commit 22148897cf
2 changed files with 3 additions and 5 deletions

View File

@@ -51,7 +51,6 @@
#include "string-util.h"
#include "udev-util.h"
#include "unaligned.h"
#include "version.h"
#define SUPPORTED_SMBIOS_VER 0x030300
@@ -663,8 +662,7 @@ static int parse_argv(int argc, char * const *argv) {
arg_source_file = optarg;
break;
case 'V':
printf("%s\n", GIT_VERSION);
return 0;
return version();
case 'h':
return help();
case '?':

View File

@@ -16,6 +16,7 @@
#include <unistd.h>
#include "alloc-util.h"
#include "build.h"
#include "device-nodes.h"
#include "extract-word.h"
#include "fd-util.h"
@@ -26,7 +27,6 @@
#include "strv.h"
#include "strxcpyx.h"
#include "udev-util.h"
#include "version.h"
static const struct option options[] = {
{ "device", required_argument, NULL, 'd' },
@@ -297,7 +297,7 @@ static int set_options(int argc, char **argv,
break;
case 'V':
printf("%s\n", GIT_VERSION);
version();
exit(EXIT_SUCCESS);
case 'x':