From d140cab6f9bbef3d7f77b91628fe8202517fa185 Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Wed, 14 Feb 2018 12:27:54 -0600 Subject: [PATCH] LU-10663 utils: clear errno before check In jt_obd_destroy() clear errno before calling strtoull() and checking it. Test-Parameters: testlist=obdfilter-survey Lustre-change: https://review.whamcloud.com/#/c/31305/ Lustre-commit: 9e488fe9413184e61dcf405c9c87ca348dd6824a Signed-off-by: John L. Hammond Change-Id: I686cd6eb0a57248177e5b0878df5e3f450fbc942 Signed-off-by: Minh Diep Reviewed-on: https://review.whamcloud.com/31430 Reviewed-by: Bob Glossman Tested-by: Jenkins Tested-by: Maloo --- lustre/utils/obd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lustre/utils/obd.c b/lustre/utils/obd.c index 2e84177..249b182 100644 --- a/lustre/utils/obd.c +++ b/lustre/utils/obd.c @@ -1712,6 +1712,7 @@ int jt_obd_destroy(int argc, char **argv) if (argc < 2 || argc > 4) return CMD_HELP; + errno = 0; id = strtoull(argv[1], &end, 0); if (*end || id == 0 || errno != 0) { fprintf(stderr, "error: %s: invalid objid '%s'\n", -- 1.8.3.1