]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Allow socket to report location of the configuration file.
authorRoy Marples <roy@marples.name>
Fri, 13 Feb 2009 15:39:34 +0000 (15:39 +0000)
committerRoy Marples <roy@marples.name>
Fri, 13 Feb 2009 15:39:34 +0000 (15:39 +0000)
dhcpcd.c

index 4d9daa2dd3a5581a2978411d6e35718906825ebc..21612bdbfa740532bfd84edbee5ef02c5c810e86 100644 (file)
--- 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) {