]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/buffer: pass `const int[2]` to close_pipe() 17909/head
authorKefu Chai <kchai@redhat.com>
Fri, 22 Sep 2017 07:48:47 +0000 (15:48 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 22 Sep 2017 07:48:57 +0000 (15:48 +0800)
be explicit instead of passing a `const int*`, this avoids the warning
from clang analyzer:

  Array subscript is undefined

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/common/buffer.cc

index bb2132fe719f636de547d89db80a5d183e4293d7..360d97453549956499ea85399d8919b636b11575 100644 (file)
@@ -550,7 +550,7 @@ using namespace ceph;
       return 0;
     }
 
-    static void close_pipe(const int *fds) {
+    static void close_pipe(const int fds[2]) {
       if (fds[0] >= 0)
        VOID_TEMP_FAILURE_RETRY(::close(fds[0]));
       if (fds[1] >= 0)