/*
* 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
*ap++ = p;
p += strlen(p) + 1;
}
- handle_args(argc, argvp);
+ handle_args(*s, argc, argvp);
}
}
}
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)
{
extern char **ifdv;
extern struct interface *ifaces;
-int handle_args(int, char **);
+int handle_args(int, int, char **);
void handle_exit_timeout(void *);
void start_interface(void *);
void start_discover(void *);