diff --git a/epoll.c b/epoll.c index 149efc2a..edca74ce 100644 --- a/epoll.c +++ b/epoll.c @@ -10,10 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Niels Provos. - * 4. The name of the author may not be used to endorse or promote products + * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR diff --git a/epoll_sub.c b/epoll_sub.c index e73c159c..431970c7 100644 --- a/epoll_sub.c +++ b/epoll_sub.c @@ -10,10 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Niels Provos. - * 4. The name of the author may not be used to endorse or promote products + * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR diff --git a/event.c b/event.c index b3d4a9f1..1dda1a7d 100644 --- a/event.c +++ b/event.c @@ -12,10 +12,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Niels Provos. - * 4. The name of the author may not be used to endorse or promote products + * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR diff --git a/event.h b/event.h index 5daa23f6..bfac3f2a 100644 --- a/event.h +++ b/event.h @@ -12,10 +12,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Niels Provos. - * 4. The name of the author may not be used to endorse or promote products + * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR diff --git a/evsignal.h b/evsignal.h index 630c18f0..8de27a5c 100644 --- a/evsignal.h +++ b/evsignal.h @@ -10,10 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Niels Provos. - * 4. The name of the author may not be used to endorse or promote products + * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR diff --git a/kqueue.c b/kqueue.c index 103715ff..949db4d2 100644 --- a/kqueue.c +++ b/kqueue.c @@ -12,10 +12,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Niels Provos. - * 4. The name of the author may not be used to endorse or promote products + * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR @@ -59,7 +56,7 @@ #define log_error warn #endif -#ifdef HAVE_INTTYPES_H +#if defined(HAVE_INTTYPES_H) && !defined(__OpenBSD__) #define INTPTR(x) (intptr_t)x #else #define INTPTR(x) x diff --git a/poll.c b/poll.c index d41755dd..b6613ba9 100644 --- a/poll.c +++ b/poll.c @@ -12,10 +12,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Niels Provos. - * 4. The name of the author may not be used to endorse or promote products + * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR diff --git a/rtsig.c b/rtsig.c index 81567f4b..960715f3 100644 --- a/rtsig.c +++ b/rtsig.c @@ -285,8 +285,9 @@ rtsig_dispatch(void *arg, struct timeval *tv) signum = sigtimedwait(&op->sigs, &info, &ts); if (signum == -1) { - if (errno == EAGAIN) break; - return errno == EINTR ? 0 : -1; + if (errno == EAGAIN) + break; + return (errno == EINTR ? 0 : -1); } ts.tv_sec = ts.tv_nsec = 0; @@ -381,8 +382,10 @@ rtsig_dispatch(void *arg, struct timeval *tv) int flags = 0; struct event *ev = op->toev[i]; - if (op->poll[i].revents & POLLIN) flags |= EV_READ; - if (op->poll[i].revents & POLLOUT) flags |= EV_WRITE; + if (op->poll[i].revents & POLLIN) + flags |= EV_READ; + if (op->poll[i].revents & POLLOUT) + flags |= EV_WRITE; if (!(ev->ev_events & EV_PERSIST)) { event_del(ev); @@ -422,6 +425,9 @@ rtsig_dispatch(void *arg, struct timeval *tv) /* We just freed it, we shouldn't have a problem getting it back. */ op->poll = malloc(sizeof(*op->poll) * op->max); op->toev = malloc(sizeof(*op->toev) * op->max); + + if (op->poll == NULL || op->toev == NULL) + err(1, "%s: malloc"); } return (0); diff --git a/select.c b/select.c index 77fdb050..0a47a6a8 100644 --- a/select.c +++ b/select.c @@ -12,10 +12,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Niels Provos. - * 4. The name of the author may not be used to endorse or promote products + * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR diff --git a/signal.c b/signal.c index c5a3a12e..c748927a 100644 --- a/signal.c +++ b/signal.c @@ -12,10 +12,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Niels Provos. - * 4. The name of the author may not be used to endorse or promote products + * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR