Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin/gpt don't print dkctl message for files
details: https://anonhg.NetBSD.org/src/rev/1e3ab6198fe7
branches: trunk
changeset: 342057:1e3ab6198fe7
user: christos <christos%NetBSD.org@localhost>
date: Fri Dec 04 01:46:32 2015 +0000
description:
don't print dkctl message for files
fix typo
diffstat:
sbin/gpt/gpt.c | 11 ++++++-----
sbin/gpt/gpt.h | 9 +++++----
2 files changed, 11 insertions(+), 9 deletions(-)
diffs (68 lines):
diff -r 5cd8295b95f1 -r 1e3ab6198fe7 sbin/gpt/gpt.c
--- a/sbin/gpt/gpt.c Fri Dec 04 01:46:12 2015 +0000
+++ b/sbin/gpt/gpt.c Fri Dec 04 01:46:32 2015 +0000
@@ -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 @@
}
}
} else {
+ gpt->flags |= GPT_FILE;
if (gpt->secsz == 0)
gpt->secsz = 512; /* Fixed size for files. */
if (gpt->mediasz == 0) {
@@ -538,7 +539,7 @@
*/
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 @@
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 @@
}
}
-
struct gpt_ent *
gpt_ent(map_t map, map_t tbl, unsigned int i)
{
diff -r 5cd8295b95f1 -r 1e3ab6198fe7 sbin/gpt/gpt.h
--- a/sbin/gpt/gpt.h Fri Dec 04 01:46:12 2015 +0000
+++ b/sbin/gpt/gpt.h Fri Dec 04 01:46:32 2015 +0000
@@ -75,10 +75,11 @@
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);
Home |
Main Index |
Thread Index |
Old Index