From 9e488fe9413184e61dcf405c9c87ca348dd6824a 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: trivial testlist=obdfilter-survey Signed-off-by: John L. Hammond Change-Id: I686cd6eb0a57248177e5b0878df5e3f450fbc942 Reviewed-on: https://review.whamcloud.com/31305 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Minh Diep Reviewed-by: Bob Glossman Reviewed-by: Oleg Drokin --- lustre/utils/obd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lustre/utils/obd.c b/lustre/utils/obd.c index 1f641ae..4e32318 100644 --- a/lustre/utils/obd.c +++ b/lustre/utils/obd.c @@ -1715,6 +1715,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