--- old/usr/src/cmd/zoneadmd/vplat.c Wed May 7 11:21:42 2008 +++ new/usr/src/cmd/zoneadmd/vplat.c Wed May 7 11:21:42 2008 @@ -24,7 +24,7 @@ * Use is subject to license terms. */ -#pragma ident "@(#)vplat.c 1.60 08/04/08 SMI" +#pragma ident "@(#)vplat.c 1.61 08/05/07 SMI" /* * This module contains functions used to bring up and tear down the @@ -804,6 +804,17 @@ } static int +isregfile(const char *path) +{ + struct stat64 st; + + if (stat64(path, &st) == -1) + return (-1); + + return (S_ISREG(st.st_mode)); +} + +static int dofsck(zlog_t *zlogp, const char *fstype, const char *rawdev) { char cmdbuf[MAXPATHLEN]; @@ -820,6 +831,12 @@ return (-1); } + /* + * If it doesn't exist, that's OK: we verified this previously. + */ + if (isregfile(cmdbuf) == -1) + return (0); + argv[0] = "fsck"; argv[1] = "-m"; argv[2] = (char *)rawdev; @@ -1261,8 +1278,12 @@ * Run 'fsck -m' if there's a device to fsck. */ if (fsptr->zone_fs_raw[0] != '\0' && - dofsck(zlogp, fsptr->zone_fs_type, fsptr->zone_fs_raw) != 0) + dofsck(zlogp, fsptr->zone_fs_type, fsptr->zone_fs_raw) != 0) { return (-1); + } else if (isregfile(fsptr->zone_fs_special) == 1 && + dofsck(zlogp, fsptr->zone_fs_type, fsptr->zone_fs_special) != 0) { + return (-1); + } /* * Build up mount option string.