From: amitkuma Date: Mon, 31 Jul 2017 14:53:32 +0000 (+0530) Subject: os: Argument cannot be negative X-Git-Tag: v12.1.3~160^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1b62ee5cb4bb7b655b514d48453200cfbfd8a492;p=ceph-ci.git os: Argument cannot be negative Fixed: ** CID 1395347 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS) 3. negative_returns: fd is passed to a parameter that cannot be negative Signed-off-by: Amit Kumar amitkuma@redhat.com --- diff --git a/src/test/os/TestLFNIndex.cc b/src/test/os/TestLFNIndex.cc index fb7a0c9f97f..77919999117 100644 --- a/src/test/os/TestLFNIndex.cc +++ b/src/test/os/TestLFNIndex.cc @@ -452,6 +452,10 @@ TEST_F(TestLFNIndex, get_mangled_name) { int main(int argc, char **argv) { int fd = ::creat("detect", 0600); + if (fd < 0){ + cerr << "failed to create file detect" << std::endl; + return EXIT_FAILURE; + } int ret = chain_fsetxattr(fd, "user.test", "A", 1); ::close(fd); ::unlink("detect");