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)
{
&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 },
};
exit(EXIT_FAILURE);
}
+ if (option_root && chdir(option_root) > 0) {
+ perror("chdir:");
+ exit(EXIT_FAILURE);
+ }
+
if (option_bluetooth)
server_id = bluetooth_listen();
else