Message ID | 149074285782.18735.18215464978773558065.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive) |
---|---|
State | Accepted |
Commit | a81bcf76be00 |
Headers | show |
diff --git a/ndctl/dimm.c b/ndctl/dimm.c index b20a84911489..4d25417fb2ae 100644 --- a/ndctl/dimm.c +++ b/ndctl/dimm.c @@ -952,9 +952,9 @@ static int dimm_action(int argc, const char **argv, void *ctx, * count if some actions succeeded, 0 if none were attempted, * negative error code otherwise. */ - if (rc < 0) - return rc; - return count; + if (count > 0) + return count; + return rc; } int cmd_write_labels(int argc, const char **argv, void *ctx)
The dimm commands return zero when some operations succeed, return the count separately from the error code. Before: # ndctl zero-labels all zeroed 0 nmem After: # ndctl zero-labels all zeroed 6 nmems Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- ndctl/dimm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)