{
int written;
+ if (ub->hdr.type != UBUS_MSG_MONITOR)
+ ubusd_monitor_message(cl, ub, true);
+
if (!cl->tx_queue[cl->txq_cur]) {
written = ubus_msg_writev(cl->sock.fd, ub, 0);
if (written >= ub->len + sizeof(ub->hdr))
while (ubus_msg_head(cl))
ubus_msg_dequeue(cl);
+ ubusd_monitor_disconnect(cl);
ubusd_proto_free_client(cl);
if (cl->pending_msg_fd >= 0)
close(cl->pending_msg_fd);
fd_buf.fd = -1;
- iov.iov_base = &cl->hdrbuf + offset;
+ iov.iov_base = ((char *) &cl->hdrbuf) + offset;
iov.iov_len = sizeof(cl->hdrbuf) - offset;
if (cl->pending_msg_fd < 0) {
cl->pending_msg_fd = -1;
cl->pending_msg_offset = 0;
cl->pending_msg = NULL;
+ ubusd_monitor_message(cl, ub, false);
ubusd_proto_receive_message(cl, ub);
goto retry;
}
{
fprintf(stderr, "Usage: %s [<options>]\n"
"Options: \n"
+ " -A <path>: Set the path to ACL files\n"
" -s <socket>: Set the unix domain socket to listen on\n"
"\n", progname);
return 1;
openlog("ubusd", LOG_PID, LOG_DAEMON);
uloop_init();
- while ((ch = getopt(argc, argv, "s:")) != -1) {
+ while ((ch = getopt(argc, argv, "A:s:")) != -1) {
switch (ch) {
case 's':
ubus_socket = optarg;
break;
+ case 'A':
+ ubusd_acl_dir = optarg;
+ break;
default:
return usage(argv[0]);
}