[torquedev] [PATCH] Bugzilla - Bug 10 - cpuset_delete() return value treated incorrectly everywhere (in 2.3-fixes)

Chris Samuel csamuel at vpac.org
Mon Jul 6 18:15:41 MDT 2009


Hi all,

Currently all calls in 2.3-fixes to cpuset_delete() treat the
return value as if it is the return from rmdir(), when it is
actually comparing that with 0 and thus inverting the return
code.

The symptom of this are lots of bogus messages about not being
able to delete unused cpusets which are actually successfully
being removed (fortunately that's the only effect)!

The fix is trivial, just make cpuset_delete() return the value
from rmdir() itself - no other changes are necessary.

NOTE: This is different to how things are done in trunk, there
there are lots of comparisons to 0 for its return value, so
problems may still lurk there.

Signed-off-by: Chris Samuel <chris at csamuel.org>
---
 branches/2.3-fixes/src/resmom/linux/cpuset.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/branches/2.3-fixes/src/resmom/linux/cpuset.c b/branches/2.3-fixes/src/resmom/linux/cpuset.c
index 289a785..44c2c71 100644
--- a/branches/2.3-fixes/src/resmom/linux/cpuset.c
+++ b/branches/2.3-fixes/src/resmom/linux/cpuset.c
@@ -103,7 +103,7 @@ int cpuset_delete(char *cpusetname)

   closedir(dir);

-  return(rmdir(path) == 0);
+  return(rmdir(path));

   }

--
1.6.0.4

-- 
Christopher Samuel - (03) 9925 4751 - Systems Manager
 The Victorian Partnership for Advanced Computing
 P.O. Box 201, Carlton South, VIC 3053, Australia
VPAC is a not-for-profit Registered Research Agency


More information about the torquedev mailing list