From 2b237d4b481f3f7c7ed92fb7c78e2de888bb007a Mon Sep 17 00:00:00 2001 From: ny155746 Date: Tue, 3 Jun 2008 22:06:31 -0700 Subject: 6632563 format reports error with device in use checking, when writing a label --- usr/src/cmd/format/checkdev.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'usr/src/cmd/format/checkdev.c') diff --git a/usr/src/cmd/format/checkdev.c b/usr/src/cmd/format/checkdev.c index 071341b0f5..c72dfebf9c 100644 --- a/usr/src/cmd/format/checkdev.c +++ b/usr/src/cmd/format/checkdev.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -339,9 +339,15 @@ checkdevinuse(char *cur_disk_path, diskaddr_t start, diskaddr_t end, int print, dm_get_slices(cur_disk_path, &slices, &error); if (error) { - err_print("Error occurred with device in use checking: %s\n", - strerror(error)); - return (found); + /* + * If ENODEV, it actually means the device is not in use. + * We will return 0 without displaying error. + */ + if (error != ENODEV) { + err_print("Error occurred with device in use" + "checking: %s\n", strerror(error)); + return (found); + } } if (slices == NULL) return (found); -- cgit v1.2.3