Commits

b...@  committed edcb255

did some small fixes for cw on FreeBSD, mostly ignored SIGWNCH

  • Participants
  • Parent commits 69dd4ca

Comments (0)

Files changed (1)

 	if ((kq = kqueue()) == -1)
 		perror("kqueue failed");
 
-	EV_SET(&change, fileno(in), EVFILT_READ,
-		EV_ADD | EV_ENABLE, NULL, 0, in);
+	EV_SET(&change, fileno(in), EVFILT_READ, 
+		EV_ADD | EV_ENABLE, NULL, 0, 0);
 	if (kevent(kq, &change, 1, NULL, 0, NULL) == -1)
 		err(1, "kevent set EVFILT_READ");
 
  	EV_SET(&change, fileno(stdin), EVFILT_READ,
-		EV_ADD | EV_ENABLE, NULL, 0, stdin);
+		EV_ADD | EV_ENABLE, NULL, 0, 0);
 	if (kevent(kq, &change, 1, NULL, 0, NULL) == -1)
 		err(1, "kevent set EVFILT_READ");
 
 	for (;;) {
 		i = kevent(kq, NULL, 0, &event, 1, NULL);
-		if (i == -1)
-			err(1, "kevent read"); 
+		if (i == -1) {
+			/* don't quit on interrupts (ie. SIGWINCH */
+			if (errno == EINTR)
+				continue;
+			else
+				err(1, "kevent read"); 
+		}
 
 		if (event.filter == EVFILT_READ) {
 			if(event.ident == fileno(stdin)) {