chiark / gitweb /
journald: remove rotated file from hashmap when rotation fails
[elogind.git] / src / journal / journald-server.c
index e888480284f6d4b6e29957b7485f4c9f660ea2a1..e03e413aeffba6fc337912d6d56bd77dfca5e9a4 100644 (file)
@@ -321,8 +321,10 @@ void server_rotate(Server *s) {
                 if (r < 0)
                         if (f)
                                 log_error("Failed to rotate %s: %s", f->path, strerror(-r));
-                        else
+                        else {
                                 log_error("Failed to create user journal: %s", strerror(-r));
+                                hashmap_remove(s->user_journals, k);
+                        }
                 else {
                         hashmap_replace(s->user_journals, k, f);
                         server_fix_perms(s, f, PTR_TO_UINT32(k));
@@ -1270,7 +1272,6 @@ int process_event(Server *s, struct epoll_event *ev) {
                 if ((ev->events|EPOLLIN|EPOLLHUP) != (EPOLLIN|EPOLLHUP)) {
                         log_error("Got invalid event from epoll for %s: %"PRIx32,
                                   "stdout stream", ev->events);
-                        log_error("Got invalid event from epoll.");
                         return -EIO;
                 }