Distinguish between return values -1 (errno set) and 0.
OK kettenis
-/* $OpenBSD: ds.c,v 1.11 2021/10/24 21:24:18 deraadt Exp $ */
+/* $OpenBSD: ds.c,v 1.12 2022/07/27 19:42:22 kn Exp $ */
/*
* Copyright (c) 2012 Mark Kettenis
while (1) {
nfds = poll(pfd, num_ds_conns, -1);
- if (nfds == -1 || nfds == 0)
- errx(1, "poll");
+ if (nfds == -1)
+ err(1, "poll");
+ if (nfds == 0)
+ errx(1, "poll timeout");
TAILQ_FOREACH(dc, &ds_conns, link) {
if (pfd[dc->id].revents)