diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2011-08-26 12:49:36 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2011-08-29 13:40:40 +0300 |
commit | 7ad3003928678de910448aa7c18a562273f0eddf (patch) | |
tree | c0aaf7c82772a22ca5c3ce64e84e30d75d7f006b /tools | |
parent | 0a2daed2d0eab0a8ff8d1739d5f6d7b61a0a0abd (diff) | |
download | obexd-7ad3003928678de910448aa7c18a562273f0eddf.tar.gz |
gobex: add root support to test-server
Diffstat (limited to 'tools')
-rw-r--r-- | tools/test-server.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/test-server.c b/tools/test-server.c index d7ffe50..728e2ad 100644 --- a/tools/test-server.c +++ b/tools/test-server.c @@ -45,6 +45,7 @@ static GSList *clients = NULL; static gboolean option_packet = FALSE; static gboolean option_bluetooth = FALSE; static int option_channel = -1; +static char *option_root = NULL; static void sig_term(int sig) { @@ -63,6 +64,8 @@ static GOptionEntry options[] = { &option_packet, "Packet based transport" }, { "stream", 's', G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &option_packet, "Stream based transport" }, + { "root", 'r', 0, G_OPTION_ARG_STRING, + &option_root, "Root dir", "/..." }, { NULL }, }; @@ -411,6 +414,11 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } + if (option_root && chdir(option_root) > 0) { + perror("chdir:"); + exit(EXIT_FAILURE); + } + if (option_bluetooth) server_id = bluetooth_listen(); else |