From a97b18fbd6cc0b400bd36eb0173af2765cf18419 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Fri, 29 May 2020 16:49:34 +0200 Subject: [PATCH] global: mark pidfile_write() with [[nodiscard]]. The goal is to never implicitly ignore errors that the function can return, particularly the failure on pidfile locking due to the file being hold by another instance. This problem happened recently in crimson-osd. Signed-off-by: Radoslaw Zarzynski --- src/global/pidfile.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/global/pidfile.h b/src/global/pidfile.h index f74df68fd49..eb613e39dea 100644 --- a/src/global/pidfile.h +++ b/src/global/pidfile.h @@ -19,7 +19,7 @@ // Write a pidfile with the current pid, using the configuration in the // provided conf structure. -int pidfile_write(std::string_view pid_file); +[[nodiscard]] int pidfile_write(std::string_view pid_file); // Remove the pid file that was previously written by pidfile_write. // This is safe to call in a signal handler context. -- 2.39.5