Module Name: src Committed By: christos Date: Fri Dec 4 01:46:32 UTC 2015
Modified Files: src/sbin/gpt: gpt.c gpt.h Log Message: don't print dkctl message for files fix typo To generate a diff of this commit: cvs rdiff -u -r1.61 -r1.62 src/sbin/gpt/gpt.c cvs rdiff -u -r1.28 -r1.29 src/sbin/gpt/gpt.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sbin/gpt/gpt.c diff -u src/sbin/gpt/gpt.c:1.61 src/sbin/gpt/gpt.c:1.62 --- src/sbin/gpt/gpt.c:1.61 Thu Dec 3 16:30:54 2015 +++ src/sbin/gpt/gpt.c Thu Dec 3 20:46:32 2015 @@ -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.61 2015/12/03 21:30:54 christos Exp $"); +__RCSID("$NetBSD: gpt.c,v 1.62 2015/12/04 01:46:32 christos Exp $"); #endif #include <sys/param.h> @@ -518,6 +518,7 @@ gpt_open(const char *dev, int flags, int } } } else { + gpt->flags |= GPT_FILE; if (gpt->secsz == 0) gpt->secsz = 512; /* Fixed size for files. */ if (gpt->mediasz == 0) { @@ -538,7 +539,7 @@ gpt_open(const char *dev, int flags, int */ devsz = gpt->mediasz / gpt->secsz; if (devsz < 6) { - gpt_warnx(gpt, "Need 6 sectorso, we have %ju", + gpt_warnx(gpt, "Need 6 sectors, we have %ju", (uintmax_t)devsz); goto close; } @@ -583,8 +584,9 @@ gpt_close(gpt_t gpt) goto out; #endif } - gpt_msg(gpt, "You need to run \"dkctl %s makewedges\"" - " for the changes to take effect\n", gpt->device_name); + if (!(gpt->flags & GPT_FILE)) + gpt_msg(gpt, "You need to run \"dkctl %s makewedges\"" + " for the changes to take effect\n", gpt->device_name); out: close(gpt->fd); @@ -715,7 +717,6 @@ gpt_create_pmbr_part(struct mbr_part *pa } } - struct gpt_ent * gpt_ent(map_t map, map_t tbl, unsigned int i) { Index: src/sbin/gpt/gpt.h diff -u src/sbin/gpt/gpt.h:1.28 src/sbin/gpt/gpt.h:1.29 --- src/sbin/gpt/gpt.h:1.28 Wed Dec 2 21:02:43 2015 +++ src/sbin/gpt/gpt.h Thu Dec 3 20:46:32 2015 @@ -75,10 +75,11 @@ uint32_t crc32(const void *, size_t); void gpt_close(gpt_t); int gpt_gpt(gpt_t, off_t, int); gpt_t gpt_open(const char *, int, int, off_t, u_int); -#define GPT_READONLY 1 -#define GPT_MODIFIED 2 -#define GPT_QUIET 4 -#define GPT_NOSYNC 8 +#define GPT_READONLY 0x01 +#define GPT_MODIFIED 0x02 +#define GPT_QUIET 0x04 +#define GPT_NOSYNC 0x08 +#define GPT_FILE 0x10 void* gpt_read(gpt_t, off_t, size_t); off_t gpt_last(gpt_t);