chiark / gitweb /
barrier: explicitly ignore return values of barrier_place()
authorDavid Herrmann <dh.herrmann@gmail.com>
Tue, 4 Nov 2014 08:49:43 +0000 (09:49 +0100)
committerDavid Herrmann <dh.herrmann@gmail.com>
Tue, 4 Nov 2014 08:49:43 +0000 (09:49 +0100)
The barrier implementation tracks remote states internally. There is no
need to check the return value of any barrier_*() function if the caller
is not interested in the result. The barrier helpers only return the state
of the remote side, which is usually not interesting as later calls to
barrier_sync() will catch this, anyway.

Shut up coverity by explicitly ignoring return values of barrier_place()
if we're not interested in it.

src/nspawn/nspawn.c
src/shared/barrier.h

index e199eb665aaff63dcb986f7b0b846558d31a31bd..fca3222a87dbc6b2b81bf39759dcc26b41416ed2 100644 (file)
@@ -3371,7 +3371,7 @@ int main(int argc, char *argv[]) {
                         /* Tell the parent that we are ready, and that
                          * it can cgroupify us to that we lack access
                          * to certain devices and resources. */
-                        barrier_place(&barrier);
+                        (void)barrier_place(&barrier);
 
                         if (chdir(arg_directory) < 0) {
                                 log_error("chdir(%s) failed: %m", arg_directory);
@@ -3550,7 +3550,7 @@ int main(int argc, char *argv[]) {
                         /* Notify the child that the parent is ready with all
                          * its setup, and that the child can now hand over
                          * control to the code to run inside the container. */
-                        barrier_place(&barrier);
+                        (void)barrier_place(&barrier);
 
                         r = sd_event_new(&event);
                         if (r < 0) {
index c55e3113448ff3e919b0804de201c3a9742d6398..d4ad2a419b6d0efd76e2ded4036b34a5e57f01d7 100644 (file)
@@ -91,6 +91,6 @@ static inline bool barrier_is_aborted(Barrier *b) {
 }
 
 static inline bool barrier_place_and_sync(Barrier *b) {
-        barrier_place(b);
+        (void)barrier_place(b);
         return barrier_sync(b);
 }