]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: do not set ioprio if pid is not set
authorLoic Dachary <loic-201408@dachary.org>
Tue, 7 Oct 2014 12:02:09 +0000 (14:02 +0200)
committerLoic Dachary <loic-201408@dachary.org>
Tue, 7 Oct 2014 12:09:17 +0000 (14:09 +0200)
Signed-off-by: Loic Dachary <loic-201408@dachary.org>
src/common/Thread.cc

index 7be0013a6676bc98a5d35515994a6f817aa69c9b..a962e06f66a4db4a328472577105c3f01da5cc42 100644 (file)
@@ -51,7 +51,8 @@ void *Thread::entry_wrapper()
   int p = ceph_gettid(); // may return -ENOSYS on other platforms
   if (p > 0)
     pid = p;
-  if (ioprio_class >= 0 &&
+  if (pid &&
+      ioprio_class >= 0 &&
       ioprio_priority >= 0) {
     ceph_ioprio_set(IOPRIO_WHO_PROCESS,
                    pid,