chiark / gitweb /
journal-remote: allow splitting incoming logs by source host
[elogind.git] / src / journal-remote / journal-upload.c
index 264f915a789d825b76b3814253f0a0cc00c0b02f..680073f4d94c75be6a67648e8499e02963129f6d 100644 (file)
@@ -297,9 +297,19 @@ static int dispatch_fd_input(sd_event_source *event,
         Uploader *u = userp;
 
         assert(u);
-        assert(revents & EPOLLIN);
         assert(fd >= 0);
 
+        if (revents & EPOLLHUP) {
+                log_debug("Received HUP");
+                close_fd_input(u);
+                return 0;
+        }
+
+        if (!(revents & EPOLLIN)) {
+                log_warning("Unexpected poll event %"PRIu32".", revents);
+                return -EINVAL;
+        }
+
         if (u->uploading) {
                 log_warning("dispatch_fd_input called when uploading, ignoring.");
                 return 0;