]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
global/signal_handler: retry if read() returns with EINTR
authorKefu Chai <kchai@redhat.com>
Wed, 23 Nov 2016 05:26:31 +0000 (13:26 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 23 Nov 2016 06:52:18 +0000 (14:52 +0800)
this silences the warning of

Value stored to 'r' is never used.

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

index f465b402d56c732cdbbd3959ff46f6f8f2b76a2f..01732cce4480ee40876d07fe3a9bc8926f8cc952 100644 (file)
@@ -281,7 +281,7 @@ struct SignalHandler : public Thread {
        char v;
 
        // consume byte from signal socket, if any.
-       r = read(pipefd[0], &v, 1);
+       TEMP_FAILURE_RETRY(read(pipefd[0], &v, 1));
 
        lock.Lock();
        for (unsigned signum=0; signum<32; signum++) {