diff options
author | Zheng Da <zhengda1936@gmail.com> | 2010-08-02 03:58:15 +0200 |
---|---|---|
committer | Zheng Da <zhengda1936@gmail.com> | 2010-08-02 03:58:15 +0200 |
commit | 16d327e60173789bfd42abb526e51bb6d9679f3f (patch) | |
tree | 291713e6b9647f49cc9cea2f0fd1462e4a6cca85 /eth-multiplexer/multiplexer.c | |
parent | cea8889d0470c0c1484cbb1246924dda139f63fc (diff) |
implement netfs_append_args in eth-multiplexer.
Diffstat (limited to 'eth-multiplexer/multiplexer.c')
-rw-r--r-- | eth-multiplexer/multiplexer.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/eth-multiplexer/multiplexer.c b/eth-multiplexer/multiplexer.c index 1d0b7ed5..3ea1408c 100644 --- a/eth-multiplexer/multiplexer.c +++ b/eth-multiplexer/multiplexer.c @@ -26,6 +26,7 @@ * to the right pfinet. */ +#include <argz.h> #include <argp.h> #include <errno.h> #include <error.h> @@ -187,3 +188,19 @@ main (int argc, char *argv[]) netfs_server_loop (); /* Never returns. */ return 0; } + +error_t +netfs_append_args (char **argz, size_t *argz_len) +{ + error_t err = 0; + +#define ADD_OPT(fmt, args...) \ + do { char buf[100]; \ + if (! err) { \ + snprintf (buf, sizeof buf, fmt , ##args); \ + err = argz_add (argz, argz_len, buf); } } while (0) + if (device_file) + ADD_OPT ("--interface=%s", device_file); +#undef ADD_OPT + return err; +} |