summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-02-13 15:39:34 +0000
committerRoy Marples <roy@marples.name>2009-02-13 15:39:34 +0000
commit3c3f38c09021f2b82a3823f35edd2d4cb2d1fb7e (patch)
tree8ac806d02090587543855f827b28bd752c78c731
parent35456091989ef70c3b5285d2c27867bc578639f3 (diff)
downloaddhcpcd-3c3f38c09021f2b82a3823f35edd2d4cb2d1fb7e.tar.xz
Allow socket to report location of the configuration file.
-rw-r--r--dhcpcd.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/dhcpcd.c b/dhcpcd.c
index 4d9daa2d..21612bdb 100644
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -1129,6 +1129,14 @@ handle_args(struct fd_list *fd, int argc, char **argv)
iov[1].iov_len = len;
writev(fd->fd, iov, 2);
return 0;
+ } else if (strcmp(*argv, "--getconfigfile") == 0) {
+ len = strlen(cffile ? cffile : CONFIG) + 1;
+ iov[0].iov_base = &len;
+ iov[0].iov_len = sizeof(ssize_t);
+ iov[1].iov_base = cffile ? cffile : UNCONST(CONFIG);
+ iov[1].iov_len = len;
+ writev(fd->fd, iov, 2);
+ return 0;
} else if (strcmp(*argv, "--getinterfaces") == 0) {
len = 0;
if (argc == 1) {