]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
global: mark pidfile_write() with [[nodiscard]].
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Fri, 29 May 2020 14:49:34 +0000 (16:49 +0200)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 2 Jun 2020 14:23:47 +0000 (16:23 +0200)
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 <rzarzyns@redhat.com>
src/global/pidfile.h

index f74df68fd49483039235f5a1377362dcd039a90c..eb613e39dea4fc238ec59bbb0807d259478ce69c 100644 (file)
@@ -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.