diff options
| author | Roy Marples <roy@marples.name> | 2009-02-05 21:06:57 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2009-02-05 21:06:57 +0000 |
| commit | 63170def69524476fd43495ab1767b8690c0e9b5 (patch) | |
| tree | 630718cff26445c4e32a56977dc71684c61272ef /dhcpcd.c | |
| parent | 73454ab163177c8684631ea234b24ee2782a6fb9 (diff) | |
| download | dhcpcd-63170def69524476fd43495ab1767b8690c0e9b5.tar.xz | |
Log our control commands.
Diffstat (limited to 'dhcpcd.c')
| -rw-r--r-- | dhcpcd.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -1115,7 +1115,9 @@ handle_args(struct fd_list *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; ssize_t len; + size_t l; struct iovec iov[2]; + char *tmp, *p; if (fd != NULL) { /* Special commands for our control socket */ @@ -1161,6 +1163,21 @@ handle_args(struct fd_list *fd, int argc, char **argv) } } + /* Log the command */ + len = 0; + for (opt = 0; opt < argc; opt++) + len += strlen(argv[opt]) + 1; + tmp = p = xmalloc(len + 1); + for (opt = 0; opt < argc; opt++) { + l = strlen(argv[opt]); + strlcpy(p, argv[opt], l + 1); + p += l; + *p++ = ' '; + } + *--p = '\0'; + syslog(LOG_INFO, "control command: %s", tmp); + free(tmp); + optind = 0; while ((opt = getopt_long(argc, argv, IF_OPTS, cf_options, &oi)) != -1) { |
