- if (unlinkat(dirfd(d), de->d_name, 0) >= 0)
- log_debug("Deleted empty journal %s/%s.", directory, de->d_name);
- else if (errno != ENOENT)
- log_warning("Failed to delete %s/%s: %m", directory, de->d_name);
+ uint64_t size = 512UL * (uint64_t) st.st_blocks;
+
+ if (unlinkat(dirfd(d), p, 0) >= 0) {
+ log_full(verbose ? LOG_INFO : LOG_DEBUG, "Deleted empty archived journal %s/%s (%s).", directory, p, format_bytes(sbytes, sizeof(sbytes), size));
+ freed += size;
+ } else if (errno != ENOENT)
+ log_warning_errno(errno, "Failed to delete empty archived journal %s/%s: %m", directory, p);
+
+ free(p);