#include "string-util.h"
#include "time-util.h"
-int notify_remove_fd_warn(const char *name) {
+static int notify_remove_fd_full(int log_level, const char *name) {
int r;
assert(name);
"FDSTOREREMOVE=1\n"
"FDNAME=%s", name);
if (r < 0)
- return log_warning_errno(r,
- "Failed to remove file descriptor \"%s\" from the store, ignoring: %m",
- name);
+ return log_full_errno(
+ log_level, r,
+ "Failed to remove file descriptor \"%s\" from the store, ignoring: %m",
+ name);
return 0;
}
+int notify_remove_fd(const char *name) {
+ return notify_remove_fd_full(LOG_DEBUG, name);
+}
+
+int notify_remove_fd_warn(const char *name) {
+ return notify_remove_fd_full(LOG_WARNING, name);
+}
+
int notify_remove_fd_warnf(const char *format, ...) {
_cleanup_free_ char *p = NULL;
va_list ap;
(void) sd_notify(false, *p);
}
+int notify_remove_fd(const char *name);
int notify_remove_fd_warn(const char *name);
int notify_remove_fd_warnf(const char *format, ...) _printf_(1, 2);
int close_and_notify_warn(int fd, const char *name);