]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
client: fix return code handling from _lseek 29626/head
authorwenpengLi <liwenpeng@inspur.com>
Tue, 13 Aug 2019 03:45:50 +0000 (11:45 +0800)
committerwenpengLi <liwenpeng@inspur.com>
Fri, 27 Sep 2019 00:56:46 +0000 (08:56 +0800)
The return type of _lseek is loff_t, but int r = _lseek in write may cause an overflow. It would be better to change it to auto, for example auto r = _lseek.

Signed-off-by: wenpengLi <liwenpeng@inspur.com>
src/client/Client.cc

index a1b2bfee15f2ee1181d24205d0c6134a216824d4..68fb6a4ebca6f20398266fe02c4be1f2dfe6202b 100644 (file)
@@ -9433,7 +9433,7 @@ int64_t Client::_write(Fh *f, int64_t offset, uint64_t size, const char *buf,
      * change out from under us.
      */
     if (f->flags & O_APPEND) {
-      int r = _lseek(f, 0, SEEK_END);
+      auto r = _lseek(f, 0, SEEK_END);
       if (r < 0) {
         unlock_fh_pos(f);
         return r;