only update the wedge information if it is supported.

This commit is contained in:
christos 2015-12-01 01:49:23 +00:00
parent 69dab31c79
commit 835e6be8c3
1 changed files with 6 additions and 3 deletions

View File

@ -35,7 +35,7 @@
__FBSDID("$FreeBSD: src/sbin/gpt/gpt.c,v 1.16 2006/07/07 02:44:23 marcel Exp $");
#endif
#ifdef __RCSID
__RCSID("$NetBSD: gpt.c,v 1.46 2015/11/30 19:59:34 christos Exp $");
__RCSID("$NetBSD: gpt.c,v 1.47 2015/12/01 01:49:23 christos Exp $");
#endif
#include <sys/param.h>
@ -572,11 +572,14 @@ gpt_open(const char *dev, int flags)
void
gpt_close(int fd)
{
int bits;
if (modified && !nosync)
if (modified && !nosync) {
#ifdef DIOCMWEDGES
int bits;
if (ioctl(fd, DIOCMWEDGES, &bits) == -1)
warn("Can't update wedge information");
#endif
}
/* XXX post processing? */
close(fd);