summaryrefslogtreecommitdiffstats
path: root/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-01-05 08:20:53 +0000
committerRoy Marples <roy@marples.name>2009-01-05 08:20:53 +0000
commitf367dc38be67d6e165780f91bf554faf1030443f (patch)
tree464e9223bc74658a4b8c62ef2ddb14d591a5da00 /dhcpcd.c
parentfcdf05ed936deaa48c030bc2cc318e9bc8f342e1 (diff)
downloaddhcpcd-f367dc38be67d6e165780f91bf554faf1030443f.tar.xz
Allow version to be returned over the control interface.
Diffstat (limited to 'dhcpcd.c')
-rw-r--r--dhcpcd.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/dhcpcd.c b/dhcpcd.c
index aa2a6020..7ef6ae5b 100644
--- a/dhcpcd.c
+++ b/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)
{