about summary refs log tree commit diff
path: root/calmwm.c
diff options
context:
space:
mode:
Diffstat (limited to 'calmwm.c')
-rw-r--r--calmwm.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/calmwm.c b/calmwm.c
index f81a2f6..39f53d8 100644
--- a/calmwm.c
+++ b/calmwm.c
@@ -19,7 +19,7 @@
  */
 
 #include <sys/types.h>
-#include <sys/queue.h>
+#include "queue.h"
 #include <sys/wait.h>
 
 #include <err.h>
@@ -44,7 +44,7 @@ struct screen_q		 Screenq = TAILQ_HEAD_INITIALIZER(Screenq);
 struct conf		 Conf;
 volatile sig_atomic_t	 cwm_status;
 
-__dead void	usage(void);
+void	usage(void);
 static void	sighdlr(int);
 static int	x_errorhandler(Display *, XErrorEvent *);
 static int	x_init(const char *);
@@ -106,15 +106,17 @@ main(int argc, char **argv)
 	xfd = x_init(display_name);
 	cwm_status = CWM_RUNNING;
 
+#ifdef __OpenBSD__
 	if (pledge("stdio rpath proc exec", NULL) == -1)
 		err(1, "pledge");
+#endif
 
 	memset(&pfd, 0, sizeof(pfd));
 	pfd[0].fd = xfd;
 	pfd[0].events = POLLIN;
 	while (cwm_status == CWM_RUNNING) {
 		xev_process();
-		if (poll(pfd, 1, INFTIM) == -1) {
+		if (poll(pfd, 1, -1) == -1) {
 			if (errno != EINTR)
 				warn("poll");
 		}
@@ -210,7 +212,7 @@ sighdlr(int sig)
 	switch (sig) {
 	case SIGCHLD:
 		/* Collect dead children. */
-		while ((pid = waitpid(WAIT_ANY, &status, WNOHANG)) > 0 ||
+		while ((pid = waitpid(-1, &status, WNOHANG)) > 0 ||
 		    (pid < 0 && errno == EINTR))
 			;
 		break;
@@ -226,7 +228,7 @@ sighdlr(int sig)
 	errno = save_errno;
 }
 
-__dead void
+void
 usage(void)
 {
 	extern char	*__progname;