mirror of
https://github.com/rsmarples/dhcpcd.git
synced 2024-11-24 10:35:03 +08:00
Allow version to be returned over the control interface.
This commit is contained in:
parent
fcdf05ed93
commit
f367dc38be
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* dhcpcd - DHCP client daemon
|
||||
* Copyright 2006-2008 Roy Marples <roy@marples.name>
|
||||
* Copyright 2006-2009 Roy Marples <roy@marples.name>
|
||||
* All rights reserved
|
||||
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -84,7 +84,7 @@ handle_control_data(void *arg)
|
||||
*ap++ = p;
|
||||
p += strlen(p) + 1;
|
||||
}
|
||||
handle_args(argc, argvp);
|
||||
handle_args(*s, argc, argvp);
|
||||
}
|
||||
}
|
||||
|
||||
|
9
dhcpcd.c
9
dhcpcd.c
@ -1098,11 +1098,18 @@ handle_signal(_unused void *arg)
|
||||
}
|
||||
|
||||
int
|
||||
handle_args(int argc, char **argv)
|
||||
handle_args(int fd, int argc, char **argv)
|
||||
{
|
||||
struct interface *ifs, *ifp, *ifl, *ifn, *ift;
|
||||
int do_exit = 0, do_release = 0, do_reboot = 0, opt, oi = 0;
|
||||
|
||||
if (strcmp(*argv, "--version") == 0) {
|
||||
if (fd != -1) {
|
||||
write(fd, VERSION, strlen(VERSION));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
optind = 0;
|
||||
while ((opt = getopt_long(argc, argv, IF_OPTS, cf_options, &oi)) != -1)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user