Browse Source

Linux hotplug: Ignore EAGAIN and EINTR from epoll_wait so debugging works

Luke Dashjr 12 years ago
parent
commit
dd477df65f
1 changed files with 9 additions and 1 deletions
  1. 9 1
      miner.c

+ 9 - 1
miner.c

@@ -11061,8 +11061,16 @@ void *hotplug_thread(__maybe_unused void *p)
 	}
 	}
 	
 	
 	struct epoll_event ev;
 	struct epoll_event ev;
-	while (epoll_wait(epfd, &ev, 1, -1) != -1)
+	int rv;
+	while (true)
 	{
 	{
+		rv = epoll_wait(epfd, &ev, 1, -1);
+		if (rv == -1)
+		{
+			if (errno == EAGAIN || errno == EINTR)
+				continue;
+			break;
+		}
 		struct udev_device * const device = udev_monitor_receive_device(mon);
 		struct udev_device * const device = udev_monitor_receive_device(mon);
 		if (!device)
 		if (!device)
 			continue;
 			continue;