Update net/thingsd to newest version. ok?
diff /usr/ports/mystuff
path + /usr/ports/mystuff
commit - 17fce22648fc099d798f7da1ff54b963eef6e305506376b7e0207c50c06b5d09
blob - 41b94dbf65616a0d860cc26b95f47d8f61d44b7a5dd96cbcfe5c67ff7da5370a
file + net/thingsd/Makefile
--- net/thingsd/Makefile
+++ net/thingsd/Makefile
@@ -3,10 +3,9 @@ CATEGORIES = net
GH_ACCOUNT = basepr1me
GH_PROJECT = thingsd
-GH_TAGNAME = 4.0.2
-REVISION = 1
+GH_TAGNAME = 5.1.0
-MAINTAINER = Tracey Emery <[email protected]>
+MAINTAINER = Tracey Emery <[email protected]>
# ISC
PERMIT_PACKAGE = Yes
commit - 17fce22648fc099d798f7da1ff54b963eef6e305506376b7e0207c50c06b5d09
blob - d5308c8caf4c7363b35a072258913239584e58b3166c7e1c74e67e783c11ff25
file + net/thingsd/distinfo
--- net/thingsd/distinfo
+++ net/thingsd/distinfo
@@ -1,2 +1,2 @@
-SHA256 (thingsd-4.0.2.tar.gz) = RT2se/5z+YJIHiEWW39QlafDy3YwzI8qlTgJlYc6kNE=
-SIZE (thingsd-4.0.2.tar.gz) = 53511
+SHA256 (thingsd-5.1.0.tar.gz) = 4hVFq6EKY6kTNUFf0q7H36WxxGoAXeffhxbM1qUSuBg=
+SIZE (thingsd-5.1.0.tar.gz) = 48892
commit - 17fce22648fc099d798f7da1ff54b963eef6e305506376b7e0207c50c06b5d09
blob - ea28b3c9491d690a1711ffe6f31a71d17e2115a0fd25c401c9a93b3ae7524267
file + /dev/null
--- net/thingsd/patches/patch-thingsctl_thingsctl_c
+++ /dev/null
@@ -1,49 +0,0 @@
-Index: thingsctl/thingsctl.c
---- thingsctl/thingsctl.c.orig
-+++ thingsctl/thingsctl.c
-@@ -104,7 +104,8 @@ main(int argc, char *argv[])
-
- if ((ibuf = malloc(sizeof(struct imsgbuf))) == NULL)
- err(1, "%s: malloc", __func__);
-- imsg_init(ibuf, ctl_sock);
-+ if (imsgbuf_init(ibuf, ctl_sock) == -1)
-+ err(1, "%s: imsgbuf_init", __func__);
- done = 0;
-
- /* Check for root only actions */
-@@ -186,12 +187,11 @@ main(int argc, char *argv[])
- usage();
- }
-
-- while (ibuf->w.queued)
-- if (msgbuf_write(&ibuf->w) <= 0 && errno != EAGAIN)
-- err(1, "write error");
-+ if (imsgbuf_flush(ibuf) == -1)
-+ err(1, "write error");
-
- while (!done) {
-- if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN)
-+ if ((n = imsgbuf_read(ibuf)) == -1)
- errx(1, "imsg_read error");
- if (n == 0) {
- if (res->action == SHOW_PACKETS)
-@@ -202,8 +202,8 @@ main(int argc, char *argv[])
- }
-
- while (!done) {
-- if ((n = imsg_get(ibuf, &imsg)) == -1)
-- errx(1, "imsg_get error");
-+ if ((n = imsgbuf_get(ibuf, &imsg)) == -1)
-+ errx(1, "imsgbuf_get error");
- if (n == 0)
- break;
-
-@@ -226,7 +226,7 @@ main(int argc, char *argv[])
- done = 1;
- break;
- }
-- printf("%s\n", imsg.data);
-+ printf("%s\n", (char *)imsg.data);
- break;
- case SHOW_THINGSD:
- done = show_parent_msg(&imsg);
commit - 17fce22648fc099d798f7da1ff54b963eef6e305506376b7e0207c50c06b5d09
blob - b7776c00aae2e9baa2adc7cc64f2069f28fb617bef25e3ad1907c9424a0138aa
file + /dev/null
--- net/thingsd/patches/patch-thingsd_config_c
+++ /dev/null
@@ -1,20 +0,0 @@
-Index: thingsd/config.c
---- thingsd/config.c.orig
-+++ thingsd/config.c
-@@ -115,14 +115,11 @@ config_getsocks(struct thingsd *env, struct imsg *imsg
- }
-
- /* create a new socket */
-- if ((sock = calloc(1, sizeof(*sock))) == NULL) {
-- if (imsg->fd != -1)
-- close(imsg->fd);
-+ if ((sock = calloc(1, sizeof(*sock))) == NULL)
- return (-1);
-- }
-
- memcpy(&sock->conf, &sock_conf, sizeof(sock->conf));
-- sock->fd = imsg->fd;
-+ sock->fd = imsg_get_fd(imsg);
-
- TAILQ_INSERT_TAIL(env->sockets, sock, entry);
-
commit - 17fce22648fc099d798f7da1ff54b963eef6e305506376b7e0207c50c06b5d09
blob - ef033a2e4b668c2a6ed565d36d9c3f37043b85ea6b1b4356140f0e3413cf905f
file + /dev/null
--- net/thingsd/patches/patch-thingsd_control_c
+++ /dev/null
@@ -1,62 +0,0 @@
-Index: thingsd/control.c
---- thingsd/control.c.orig
-+++ thingsd/control.c
-@@ -315,7 +315,12 @@ control_accept(int listenfd, short event, void *arg)
- return;
- }
-
-- imsg_init(&c->iev.ibuf, connfd);
-+ if (imsgbuf_init(&c->iev.ibuf, connfd) == -1) {
-+ log_warn("%s: failed to init imsgbuf", __func__);
-+ close(connfd);
-+ free(c);
-+ return;
-+ }
-
- c->iev.handler = control_dispatch_imsg;
- c->iev.events = EV_READ;
-@@ -358,7 +363,7 @@ control_close(struct privsep *ps, struct imsg *imsg, i
- &fd, sizeof(fd)) == -1)
- log_warn("fd not sent to thingsd to close");
-
-- msgbuf_clear(&c->iev.ibuf.w);
-+ imsgbuf_clear(&c->iev.ibuf);
- TAILQ_REMOVE(&ctl_conns, c, entry);
-
- event_del(&c->iev.ev);
-@@ -397,22 +402,22 @@ control_dispatch_imsg(int fd, short event, void *arg)
- }
-
- if (event & EV_READ) {
-- n = imsg_read(&c->iev.ibuf);
-- if ((n == -1 && errno != EAGAIN) || n == 0) {
-+ n = imsgbuf_read(&c->iev.ibuf);
-+ if (n == -1 || n == 0) {
- control_close(ps, &imsg, fd, cs);
- return;
- }
- }
-
- if (event & EV_WRITE) {
-- if (msgbuf_write(&c->iev.ibuf.w) <= 0 && errno != EAGAIN) {
-+ if (imsgbuf_write(&c->iev.ibuf) == -1) {
- control_close(ps, &imsg, fd, cs);
- return;
- }
- }
-
- for (;;) {
-- n = imsg_get(&c->iev.ibuf, &imsg);
-+ n = imsgbuf_get(&c->iev.ibuf, &imsg);
- if (n == -1) {
- control_close(ps, &imsg, fd, cs);
- return;
-@@ -505,7 +510,7 @@ control_dispatch_imsg(int fd, short event, void *arg)
- fail:
- imsg_compose_event(&c->iev, IMSG_CTL_FAIL,
- 0, 0, -1, &ret, sizeof(ret));
-- imsg_flush(&c->iev.ibuf);
-+ imsgbuf_flush(&c->iev.ibuf);
- control_close(ps, &imsg, fd, cs);
- }
-
commit - 17fce22648fc099d798f7da1ff54b963eef6e305506376b7e0207c50c06b5d09
blob - 587777a5beaecbb19e1d32bb2e6a42606f24aa80ecd9d121dc515d6848b9c555
file + /dev/null
--- net/thingsd/patches/patch-thingsd_proc_c
+++ /dev/null
@@ -1,126 +0,0 @@
-Index: thingsd/proc.c
---- thingsd/proc.c.orig
-+++ thingsd/proc.c
-@@ -183,7 +183,10 @@ proc_connect(struct privsep *ps)
-
- for (inst = 0; inst < ps->ps_instances[dst]; inst++) {
- iev = &ps->ps_ievs[dst][inst];
-- imsg_init(&iev->ibuf, ps->ps_pp->pp_pipes[dst][inst]);
-+ if (imsgbuf_init(&iev->ibuf,
-+ ps->ps_pp->pp_pipes[dst][inst]) == -1)
-+ fatal(NULL);
-+ imsgbuf_allow_fdpass(&iev->ibuf);
- event_set(&iev->ev, iev->ibuf.fd, iev->events,
- iev->handler, iev->data);
- event_add(&iev->ev, NULL);
-@@ -289,7 +292,9 @@ proc_accept(struct privsep *ps, int fd, enum privsep_p
- pp->pp_pipes[dst][n] = fd;
-
- iev = &ps->ps_ievs[dst][n];
-- imsg_init(&iev->ibuf, fd);
-+ if (imsgbuf_init(&iev->ibuf, fd) == -1)
-+ fatal(NULL);
-+ imsgbuf_allow_fdpass(&iev->ibuf);
- event_set(&iev->ev, iev->ibuf.fd, iev->events, iev->handler, iev->data);
- event_add(&iev->ev, NULL);
- }
-@@ -474,7 +479,7 @@ proc_close(struct privsep *ps)
-
- /* Cancel the fd, close and invalidate the fd */
- event_del(&(ps->ps_ievs[dst][n].ev));
-- imsg_clear(&(ps->ps_ievs[dst][n].ibuf));
-+ imsgbuf_clear(&(ps->ps_ievs[dst][n].ibuf));
- close(pp->pp_pipes[dst][n]);
- pp->pp_pipes[dst][n] = -1;
- }
-@@ -616,8 +621,7 @@ proc_dispatch(int fd, short event, void *arg)
- struct privsep *ps = p->p_ps;
- struct imsgbuf *ibuf;
- struct imsg imsg;
-- ssize_t n;
-- int verbose;
-+ int n, verbose;
- const char *title;
- struct privsep_fd pf;
-
-@@ -625,7 +629,7 @@ proc_dispatch(int fd, short event, void *arg)
- ibuf = &iev->ibuf;
-
- if (event & EV_READ) {
-- if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN)
-+ if ((n = imsgbuf_read(ibuf)) == -1)
- fatal("%s: imsg_read", __func__);
- if (n == 0) {
- /* this pipe is dead, so remove the event handler */
-@@ -636,19 +640,20 @@ proc_dispatch(int fd, short event, void *arg)
- }
-
- if (event & EV_WRITE) {
-- if ((n = msgbuf_write(&ibuf->w)) == -1 && errno != EAGAIN)
-+ if ((n = imsgbuf_write(ibuf)) == -1) {
-+ if (errno == EPIPE) {
-+ /* this pipe is dead */
-+ event_del(&iev->ev);
-+ event_loopexit(NULL);
-+ return;
-+ }
- fatal("%s: msgbuf_write", __func__);
-- if (n == 0) {
-- /* this pipe is dead, so remove the event handler */
-- event_del(&iev->ev);
-- event_loopexit(NULL);
-- return;
- }
- }
-
- for (;;) {
-- if ((n = imsg_get(ibuf, &imsg)) == -1)
-- fatal("%s: imsg_get", __func__);
-+ if ((n = imsgbuf_get(ibuf, &imsg)) == -1)
-+ fatal("%s: imsgbuf_get", __func__);
- if (n == 0)
- break;
-
-@@ -679,7 +684,7 @@ proc_dispatch(int fd, short event, void *arg)
- case IMSG_CTL_PROCFD:
- IMSG_SIZE_CHECK(&imsg, &pf);
- memcpy(&pf, imsg.data, sizeof(pf));
-- proc_accept(ps, imsg.fd, pf.pf_procid,
-+ proc_accept(ps, imsg_get_fd(&imsg), pf.pf_procid,
- pf.pf_instance);
- break;
- default:
-@@ -712,12 +717,12 @@ void
- imsg_event_add(struct imsgev *iev)
- {
- if (iev->handler == NULL) {
-- imsg_flush(&iev->ibuf);
-+ imsgbuf_flush(&iev->ibuf);
- return;
- }
-
- iev->events = EV_READ;
-- if (iev->ibuf.w.queued)
-+ if (imsgbuf_queuelen(&iev->ibuf) > 0)
- iev->events |= EV_WRITE;
-
- event_del(&iev->ev);
-@@ -814,7 +819,8 @@ proc_forward_imsg(struct privsep *ps, struct imsg *ims
- enum privsep_procid id, int n)
- {
- return (proc_compose_imsg(ps, id, n, imsg->hdr.type,
-- imsg->hdr.peerid, imsg->fd, imsg->data, IMSG_DATA_SIZE(imsg)));
-+ imsg->hdr.peerid, imsg_get_fd(imsg), imsg->data,
-+ IMSG_DATA_SIZE(imsg)));
- }
-
- struct imsgbuf *
-@@ -847,7 +853,7 @@ proc_flush_imsg(struct privsep *ps, enum privsep_proci
- if ((ibuf = proc_ibuf(ps, id, n)) == NULL)
- return (-1);
- do {
-- ret = imsg_flush(ibuf);
-+ ret = imsgbuf_flush(ibuf);
- } while (ret == -1 && errno == EAGAIN);
- if (ret == -1)
- break;