CVS commit: src/lib/libc/gen
Module Name:src Committed By: joerg Date: Sat Apr 13 10:16:27 UTC 2013 Modified Files: src/lib/libc/gen: tolower_.c toupper_.c Log Message: Use more consistent naming for tolower/toupper translation table for the C locale. From Takehiko Nozaki with changes to use __BUILD_LEGACY. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/lib/libc/gen/tolower_.c \ src/lib/libc/gen/toupper_.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/gen/tolower_.c diff -u src/lib/libc/gen/tolower_.c:1.13 src/lib/libc/gen/tolower_.c:1.14 --- src/lib/libc/gen/tolower_.c:1.13 Tue Jun 1 13:52:08 2010 +++ src/lib/libc/gen/tolower_.c Sat Apr 13 10:16:27 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: tolower_.c,v 1.13 2010/06/01 13:52:08 tnozaki Exp $ */ +/* $NetBSD: tolower_.c,v 1.14 2013/04/13 10:16:27 joerg Exp $ */ /* * Written by J.T. Conklin . @@ -7,7 +7,7 @@ #include #if defined(LIBC_RCS) && !defined(lint) -__RCSID("$NetBSD: tolower_.c,v 1.13 2010/06/01 13:52:08 tnozaki Exp $"); +__RCSID("$NetBSD: tolower_.c,v 1.14 2013/04/13 10:16:27 joerg Exp $"); #endif /* LIBC_RCS and not lint */ #include @@ -18,7 +18,7 @@ __RCSID("$NetBSD: tolower_.c,v 1.13 2010 #error "EOF != -1" #endif -const short _C_tolower_[1 + _CTYPE_NUM_CHARS] = { +const short _C_tolower_tab_[1 + _CTYPE_NUM_CHARS] = { EOF, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, @@ -54,4 +54,10 @@ const short _C_tolower_[1 + _CTYPE_NUM_C 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }; -const short *_tolower_tab_ = &_C_tolower_[0]; +#ifdef __BUILD_LEGACY +#ifdef __weak_alias +__weak_alias(_C_tolower_, _C_tolower_tab_) +#endif +#endif + +const short *_tolower_tab_ = &_C_tolower_tab_[0]; Index: src/lib/libc/gen/toupper_.c diff -u src/lib/libc/gen/toupper_.c:1.13 src/lib/libc/gen/toupper_.c:1.14 --- src/lib/libc/gen/toupper_.c:1.13 Tue Jun 1 13:52:08 2010 +++ src/lib/libc/gen/toupper_.c Sat Apr 13 10:16:27 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: toupper_.c,v 1.13 2010/06/01 13:52:08 tnozaki Exp $ */ +/* $NetBSD: toupper_.c,v 1.14 2013/04/13 10:16:27 joerg Exp $ */ /* * Written by J.T. Conklin . @@ -7,7 +7,7 @@ #include #if defined(LIBC_RCS) && !defined(lint) -__RCSID("$NetBSD: toupper_.c,v 1.13 2010/06/01 13:52:08 tnozaki Exp $"); +__RCSID("$NetBSD: toupper_.c,v 1.14 2013/04/13 10:16:27 joerg Exp $"); #endif /* LIBC_RCS and not lint */ #include @@ -18,7 +18,7 @@ __RCSID("$NetBSD: toupper_.c,v 1.13 2010 #error "EOF != -1" #endif -const short _C_toupper_[1 + _CTYPE_NUM_CHARS] = { +const short _C_toupper_tab_[1 + _CTYPE_NUM_CHARS] = { EOF, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, @@ -54,4 +54,10 @@ const short _C_toupper_[1 + _CTYPE_NUM_C 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }; -const short *_toupper_tab_ = &_C_toupper_[0]; +#ifdef __BUILD_LEGACY +#ifdef __weak_alias +__weak_alias(_C_toupper_, _C_toupper_tab_) +#endif +#endif + +const short *_toupper_tab_ = &_C_toupper_tab_[0];
CVS commit: src
Module Name:src Committed By: joerg Date: Sat Apr 13 10:21:21 UTC 2013 Modified Files: src/external/gpl3/gcc/dist/libstdc++-v3/config/os/bsd/netbsd: ctype_base.h ctype_noninline.h src/gnu/dist/gcc4/libstdc++-v3/config/os/bsd/netbsd: ctype_base.h ctype_noninline.h src/lib/libc: shlib_version src/lib/libc/citrus: citrus_lc_ctype.c src/lib/libc/gen: ctype_.c isctype.c src/lib/libc/locale: ctype_local.h global_locale.c rune.c runetable.c runetype_local.h runetype_misc.h setlocale_local.h src/sys/sys: ctype_bits.h ctype_inline.h Log Message: Extend ctype classification table to 16bit. Based on patch by Takehiko Nozaki, with changes to compile fail when using the old names and to exploit __BUILD_LEGACY To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 \ src/external/gpl3/gcc/dist/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h cvs rdiff -u -r1.1.1.1 -r1.2 \ src/external/gpl3/gcc/dist/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h cvs rdiff -u -r1.2 -r1.3 \ src/gnu/dist/gcc4/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h cvs rdiff -u -r1.1.1.1 -r1.2 \ src/gnu/dist/gcc4/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h cvs rdiff -u -r1.238 -r1.239 src/lib/libc/shlib_version cvs rdiff -u -r1.10 -r1.11 src/lib/libc/citrus/citrus_lc_ctype.c cvs rdiff -u -r1.19 -r1.20 src/lib/libc/gen/ctype_.c cvs rdiff -u -r1.21 -r1.22 src/lib/libc/gen/isctype.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/locale/ctype_local.h cvs rdiff -u -r1.13 -r1.14 src/lib/libc/locale/global_locale.c cvs rdiff -u -r1.45 -r1.46 src/lib/libc/locale/rune.c cvs rdiff -u -r1.27 -r1.28 src/lib/libc/locale/runetable.c cvs rdiff -u -r1.12 -r1.13 src/lib/libc/locale/runetype_local.h cvs rdiff -u -r1.3 -r1.4 src/lib/libc/locale/runetype_misc.h cvs rdiff -u -r1.8 -r1.9 src/lib/libc/locale/setlocale_local.h cvs rdiff -u -r1.2 -r1.3 src/sys/sys/ctype_bits.h src/sys/sys/ctype_inline.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl3/gcc/dist/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h diff -u src/external/gpl3/gcc/dist/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h:1.2 src/external/gpl3/gcc/dist/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h:1.3 --- src/external/gpl3/gcc/dist/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h:1.2 Tue Jun 21 02:41:39 2011 +++ src/external/gpl3/gcc/dist/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h Sat Apr 13 10:21:20 2013 @@ -41,18 +41,18 @@ _GLIBCXX_BEGIN_NAMESPACE(std) // NB: Offsets into ctype::_M_table force a particular size // on the mask type. Because of this, we don't use an enum. -typedef unsigned char mask; +typedef unsigned short mask; static const mask upper = _CTYPE_U; static const mask lower = _CTYPE_L; -static const mask alpha = _CTYPE_U | _CTYPE_L; -static const mask digit = _CTYPE_N; -static const mask xdigit = _CTYPE_N | _CTYPE_X; +static const mask alpha = _CTYPE_A; +static const mask digit = _CTYPE_D; +static const mask xdigit = _CTYPE_X; static const mask space = _CTYPE_S; -static const mask print = _CTYPE_P | _CTYPE_U | _CTYPE_L | _CTYPE_N | _CTYPE_B; -static const mask graph = _CTYPE_P | _CTYPE_U | _CTYPE_L | _CTYPE_N; +static const mask print = _CTYPE_R; +static const mask graph = _CTYPE_G; static const mask cntrl = _CTYPE_C; static const mask punct = _CTYPE_P; -static const mask alnum = _CTYPE_U | _CTYPE_L | _CTYPE_N; +static const mask alnum = _CTYPE_A | _CTYPE_D; }; _GLIBCXX_END_NAMESPACE Index: src/external/gpl3/gcc/dist/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h diff -u src/external/gpl3/gcc/dist/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h:1.1.1.1 src/external/gpl3/gcc/dist/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h:1.2 --- src/external/gpl3/gcc/dist/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h:1.1.1.1 Tue Jun 21 01:24:50 2011 +++ src/external/gpl3/gcc/dist/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h Sat Apr 13 10:21:20 2013 @@ -33,11 +33,11 @@ // Information as gleaned from /usr/include/ctype.h - extern "C" const u_int8_t _C_ctype_[]; + extern "C" const unsigned short _C_ctype_tab_[]; const ctype_base::mask* ctype::classic_table() throw() - { return _C_ctype_ + 1; } + { return _C_ctype_tab_ + 1; } ctype::ctype(__c_locale, const mask* __table, bool __del, size_t __refs) Index: src/gnu/dist/gcc4/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h diff -u src/gnu/dist/gcc4/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h:1.2 src/gnu/dist/gcc4/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h:1.3 --- src/gnu/dist/gcc4/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h:1.2 Tue Dec 14 02:28:57 2010 +++ src/gnu/dist/gcc4/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h Sat Apr
CVS commit: src/sbin/gpt
Module Name:src Committed By: jakllsch Date: Sat Apr 13 16:48:04 UTC 2013 Modified Files: src/sbin/gpt: label.c remove.c Log Message: Use correct spelling of "secondary" in comments. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sbin/gpt/label.c cvs rdiff -u -r1.6 -r1.7 src/sbin/gpt/remove.c 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/label.c diff -u src/sbin/gpt/label.c:1.8 src/sbin/gpt/label.c:1.9 --- src/sbin/gpt/label.c:1.8 Sat Aug 27 17:38:16 2011 +++ src/sbin/gpt/label.c Sat Apr 13 16:48:03 2013 @@ -29,7 +29,7 @@ __FBSDID("$FreeBSD: src/sbin/gpt/label.c,v 1.3 2006/10/04 18:20:25 marcel Exp $"); #endif #ifdef __RCSID -__RCSID("$NetBSD: label.c,v 1.8 2011/08/27 17:38:16 joerg Exp $"); +__RCSID("$NetBSD: label.c,v 1.9 2013/04/13 16:48:03 jakllsch Exp $"); #endif #include @@ -133,7 +133,7 @@ label(int fd) ent = (void*)((char*)lbt->map_data + i * le32toh(hdr->hdr_entsz)); - /* Label the secundary entry. */ + /* Label the secondary entry. */ utf8_to_utf16(name, ent->ent_name, 36); hdr->hdr_crc_table = htole32(crc32(lbt->map_data, Index: src/sbin/gpt/remove.c diff -u src/sbin/gpt/remove.c:1.6 src/sbin/gpt/remove.c:1.7 --- src/sbin/gpt/remove.c:1.6 Sat Aug 27 17:38:16 2011 +++ src/sbin/gpt/remove.c Sat Apr 13 16:48:03 2013 @@ -29,7 +29,7 @@ __FBSDID("$FreeBSD: src/sbin/gpt/remove.c,v 1.10 2006/10/04 18:20:25 marcel Exp $"); #endif #ifdef __RCSID -__RCSID("$NetBSD: remove.c,v 1.6 2011/08/27 17:38:16 joerg Exp $"); +__RCSID("$NetBSD: remove.c,v 1.7 2013/04/13 16:48:03 jakllsch Exp $"); #endif #include @@ -132,7 +132,7 @@ rem(int fd) ent = (void*)((char*)lbt->map_data + i * le32toh(hdr->hdr_entsz)); - /* Remove the secundary entry. */ + /* Remove the secondary entry. */ uuid_create_nil((uuid_t *)&ent->ent_type, NULL); hdr->hdr_crc_table = htole32(crc32(lbt->map_data,
CVS commit: src/sbin/gpt
Module Name:src Committed By: jakllsch Date: Sat Apr 13 18:04:33 UTC 2013 Modified Files: src/sbin/gpt: add.c create.c gpt.c gpt.h label.c migrate.c remove.c show.c Log Message: Clean up gpt(8) a bit more uuid_create_nil(3) and uuid_is_nil(3) take a uuid_t*, not a pointer to an array of bytes merely casted to compatible type. Additonally, there no need for extra casts and address-of operations when using le_uuid_*() functions. Furthermore, le_uuid_*() are identical to uuid_*_le functions in libc/libuuid, so use those instead on NetBSD. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sbin/gpt/add.c cvs rdiff -u -r1.5 -r1.6 src/sbin/gpt/create.c src/sbin/gpt/gpt.h \ src/sbin/gpt/migrate.c cvs rdiff -u -r1.18 -r1.19 src/sbin/gpt/gpt.c cvs rdiff -u -r1.9 -r1.10 src/sbin/gpt/label.c cvs rdiff -u -r1.7 -r1.8 src/sbin/gpt/remove.c cvs rdiff -u -r1.8 -r1.9 src/sbin/gpt/show.c 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/add.c diff -u src/sbin/gpt/add.c:1.11 src/sbin/gpt/add.c:1.12 --- src/sbin/gpt/add.c:1.11 Sat Aug 27 17:38:16 2011 +++ src/sbin/gpt/add.c Sat Apr 13 18:04:33 2013 @@ -29,7 +29,7 @@ __FBSDID("$FreeBSD: src/sbin/gpt/add.c,v 1.14 2006/06/22 22:05:28 marcel Exp $"); #endif #ifdef __RCSID -__RCSID("$NetBSD: add.c,v 1.11 2011/08/27 17:38:16 joerg Exp $"); +__RCSID("$NetBSD: add.c,v 1.12 2013/04/13 18:04:33 jakllsch Exp $"); #endif #include @@ -65,6 +65,7 @@ usage_add(void) static void add(int fd) { + uuid_t uuid; map_t *gpt, *tpg; map_t *tbl, *lbt; map_t *map; @@ -105,7 +106,8 @@ add(int fd) i = entry - 1; ent = (void*)((char*)tbl->map_data + i * le32toh(hdr->hdr_entsz)); - if (!uuid_is_nil((uuid_t *)&ent->ent_type, NULL)) { + le_uuid_dec(ent->ent_type, &uuid); + if (!uuid_is_nil(&uuid, NULL)) { warnx("%s: error: entry at index %u is not free", device_name, entry); return; @@ -115,7 +117,8 @@ add(int fd) for (i = 0; i < le32toh(hdr->hdr_entries); i++) { ent = (void*)((char*)tbl->map_data + i * le32toh(hdr->hdr_entsz)); - if (uuid_is_nil((uuid_t *)&ent->ent_type, NULL)) + le_uuid_dec(ent->ent_type, &uuid); + if (uuid_is_nil(&uuid, NULL)) break; } if (i == le32toh(hdr->hdr_entries)) { @@ -131,7 +134,7 @@ add(int fd) return; } - le_uuid_enc((uuid_t *)&ent->ent_type, &type); + le_uuid_enc(ent->ent_type, &type); ent->ent_lba_start = htole64(map->map_start); ent->ent_lba_end = htole64(map->map_start + map->map_size - 1LL); @@ -146,7 +149,7 @@ add(int fd) hdr = tpg->map_data; ent = (void*)((char*)lbt->map_data + i * le32toh(hdr->hdr_entsz)); - le_uuid_enc(&ent->ent_type, &type); + le_uuid_enc(ent->ent_type, &type); ent->ent_lba_start = htole64(map->map_start); ent->ent_lba_end = htole64(map->map_start + map->map_size - 1LL); Index: src/sbin/gpt/create.c diff -u src/sbin/gpt/create.c:1.5 src/sbin/gpt/create.c:1.6 --- src/sbin/gpt/create.c:1.5 Sat Aug 27 17:38:16 2011 +++ src/sbin/gpt/create.c Sat Apr 13 18:04:33 2013 @@ -29,7 +29,7 @@ __FBSDID("$FreeBSD: src/sbin/gpt/create.c,v 1.11 2005/08/31 01:47:19 marcel Exp $"); #endif #ifdef __RCSID -__RCSID("$NetBSD: create.c,v 1.5 2011/08/27 17:38:16 joerg Exp $"); +__RCSID("$NetBSD: create.c,v 1.6 2013/04/13 18:04:33 jakllsch Exp $"); #endif #include @@ -171,7 +171,7 @@ create(int fd) hdr->hdr_lba_start = htole64(tbl->map_start + blocks); hdr->hdr_lba_end = htole64(last - blocks - 1LL); uuid_create(&uuid, NULL); - le_uuid_enc((uuid_t *)&hdr->hdr_uuid, &uuid); + le_uuid_enc(hdr->hdr_uuid, &uuid); hdr->hdr_lba_table = htole64(tbl->map_start); hdr->hdr_entries = htole32((blocks * secsz) / sizeof(struct gpt_ent)); if (le32toh(hdr->hdr_entries) > parts) @@ -181,7 +181,7 @@ create(int fd) ent = tbl->map_data; for (i = 0; i < le32toh(hdr->hdr_entries); i++) { uuid_create(&uuid, NULL); - le_uuid_enc((uuid_t *)&ent[i].ent_uuid, &uuid); + le_uuid_enc(ent[i].ent_uuid, &uuid); } hdr->hdr_crc_table = htole32(crc32(ent, le32toh(hdr->hdr_entries) * Index: src/sbin/gpt/gpt.h diff -u src/sbin/gpt/gpt.h:1.5 src/sbin/gpt/gpt.h:1.6 --- src/sbin/gpt/gpt.h:1.5 Thu Jan 6 01:08:48 2011 +++ src/sbin/gpt/gpt.h Sat Apr 13 18:04:33 2013 @@ -47,8 +47,13 @@ #include +#ifdef __NetBSD__ +#define le_uuid_dec uuid_dec_le +#define le_uuid_enc uuid_enc_le +#else void le_uuid_dec(void const *, uuid_t *); void le_uuid_enc(void *, uuid_t const *); +#endif int parse_uuid(const char *, uuid_t *); struct mbr_part { Index: src/sbin/gpt/migrate.c diff -u src/sbin/gpt/migrate.c:1.5 src/sbin/gpt/migrate.c:1.6 --- src/sbin/gpt/migrate.c:1.5 Sat Aug 27 17:38:16 2011 +++ src/sbin/gpt/migrate.c Sat Apr 13 18:04:33 2013 @@ -29,7 +29,7 @@ __FBSDID("$FreeBSD: src/sbin/gpt/migrate.c,v 1.16 2005/09/01 02:42:52 marcel Exp $"); #endif #ifdef __RCSID -__RCSID("$NetBSD: migrate.c,v 1.5 2011/08/27 17:38:16
CVS commit: src/sbin/gpt
Module Name:src Committed By: jakllsch Date: Sat Apr 13 18:25:57 UTC 2013 Modified Files: src/sbin/gpt: biosboot.c Log Message: drop trailing whitespace To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sbin/gpt/biosboot.c 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/biosboot.c diff -u src/sbin/gpt/biosboot.c:1.5 src/sbin/gpt/biosboot.c:1.6 --- src/sbin/gpt/biosboot.c:1.5 Sat Aug 27 17:38:16 2011 +++ src/sbin/gpt/biosboot.c Sat Apr 13 18:25:56 2013 @@ -1,9 +1,9 @@ -/* $NetBSD: biosboot.c,v 1.5 2011/08/27 17:38:16 joerg Exp $ */ +/* $NetBSD: biosboot.c,v 1.6 2013/04/13 18:25:56 jakllsch Exp $ */ /* - * Copyright (c) 2009 The NetBSD Foundation, Inc. + * Copyright (c) 2009 The NetBSD Foundation, Inc. * All rights reserved. - * + * * This code is derived from software contributed to the NetBSD Foundation * by Mike M. Volokhov. Development of this software was supported by the * Google Summer of Code program. @@ -33,7 +33,7 @@ #include #ifdef __RCSID -__RCSID("$NetBSD: biosboot.c,v 1.5 2011/08/27 17:38:16 joerg Exp $"); +__RCSID("$NetBSD: biosboot.c,v 1.6 2013/04/13 18:25:56 jakllsch Exp $"); #endif #include
CVS commit: src/sbin/gpt
Module Name:src Committed By: jakllsch Date: Sat Apr 13 18:32:01 UTC 2013 Modified Files: src/sbin/gpt: add.c gpt.c migrate.c show.c Log Message: Make pre-initialized partition type uuid_t symbols 'static const'. This conserves a few hundred bytes of total program size by allowing the linker to merge duplicates. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sbin/gpt/add.c cvs rdiff -u -r1.19 -r1.20 src/sbin/gpt/gpt.c cvs rdiff -u -r1.6 -r1.7 src/sbin/gpt/migrate.c cvs rdiff -u -r1.9 -r1.10 src/sbin/gpt/show.c 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/add.c diff -u src/sbin/gpt/add.c:1.12 src/sbin/gpt/add.c:1.13 --- src/sbin/gpt/add.c:1.12 Sat Apr 13 18:04:33 2013 +++ src/sbin/gpt/add.c Sat Apr 13 18:32:01 2013 @@ -29,7 +29,7 @@ __FBSDID("$FreeBSD: src/sbin/gpt/add.c,v 1.14 2006/06/22 22:05:28 marcel Exp $"); #endif #ifdef __RCSID -__RCSID("$NetBSD: add.c,v 1.12 2013/04/13 18:04:33 jakllsch Exp $"); +__RCSID("$NetBSD: add.c,v 1.13 2013/04/13 18:32:01 jakllsch Exp $"); #endif #include @@ -218,7 +218,7 @@ cmd_add(int argc, char *argv[]) /* Create NetBSD FFS partitions by default. */ if (uuid_is_nil(&type, NULL)) { - uuid_t nb_ffs = GPT_ENT_TYPE_NETBSD_FFS; + static const uuid_t nb_ffs = GPT_ENT_TYPE_NETBSD_FFS; type = nb_ffs; } Index: src/sbin/gpt/gpt.c diff -u src/sbin/gpt/gpt.c:1.19 src/sbin/gpt/gpt.c:1.20 --- src/sbin/gpt/gpt.c:1.19 Sat Apr 13 18:04:33 2013 +++ src/sbin/gpt/gpt.c Sat Apr 13 18:32:01 2013 @@ -31,7 +31,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.19 2013/04/13 18:04:33 jakllsch Exp $"); +__RCSID("$NetBSD: gpt.c,v 1.20 2013/04/13 18:32:01 jakllsch Exp $"); #endif #include @@ -287,78 +287,78 @@ parse_uuid(const char *s, uuid_t *uuid) switch (*s) { case 'b': if (strcmp(s, "bios") == 0) { - uuid_t bios = GPT_ENT_TYPE_BIOS; + static const uuid_t bios = GPT_ENT_TYPE_BIOS; *uuid = bios; return (0); } break; case 'c': if (strcmp(s, "ccd") == 0) { - uuid_t ccd = GPT_ENT_TYPE_NETBSD_CCD; + static const uuid_t ccd = GPT_ENT_TYPE_NETBSD_CCD; *uuid = ccd; return (0); } else if (strcmp(s, "cgd") == 0) { - uuid_t cgd = GPT_ENT_TYPE_NETBSD_CGD; + static const uuid_t cgd = GPT_ENT_TYPE_NETBSD_CGD; *uuid = cgd; return (0); } break; case 'e': if (strcmp(s, "efi") == 0) { - uuid_t efi = GPT_ENT_TYPE_EFI; + static const uuid_t efi = GPT_ENT_TYPE_EFI; *uuid = efi; return (0); } break; case 'f': if (strcmp(s, "ffs") == 0) { - uuid_t nb_ffs = GPT_ENT_TYPE_NETBSD_FFS; + static const uuid_t nb_ffs = GPT_ENT_TYPE_NETBSD_FFS; *uuid = nb_ffs; return (0); } break; case 'h': if (strcmp(s, "hfs") == 0) { - uuid_t hfs = GPT_ENT_TYPE_APPLE_HFS; + static const uuid_t hfs = GPT_ENT_TYPE_APPLE_HFS; *uuid = hfs; return (0); } break; case 'l': if (strcmp(s, "lfs") == 0) { - uuid_t lfs = GPT_ENT_TYPE_NETBSD_LFS; + static const uuid_t lfs = GPT_ENT_TYPE_NETBSD_LFS; *uuid = lfs; return (0); } else if (strcmp(s, "linux") == 0) { - uuid_t lnx = GPT_ENT_TYPE_LINUX_DATA; + static const uuid_t lnx = GPT_ENT_TYPE_LINUX_DATA; *uuid = lnx; return (0); } break; case 'r': if (strcmp(s, "raid") == 0) { - uuid_t raid = GPT_ENT_TYPE_NETBSD_RAIDFRAME; + static const uuid_t raid = GPT_ENT_TYPE_NETBSD_RAIDFRAME; *uuid = raid; return (0); } break; case 's': if (strcmp(s, "swap") == 0) { - uuid_t sw = GPT_ENT_TYPE_NETBSD_SWAP; + static const uuid_t sw = GPT_ENT_TYPE_NETBSD_SWAP; *uuid = sw; return (0); } break; case 'u': if (strcmp(s, "ufs") == 0) { - uuid_t ufs = GPT_ENT_TYPE_NETBSD_FFS; + static const uuid_t ufs = GPT_ENT_TYPE_NETBSD_FFS; *uuid = ufs; return (0); } break; case 'w': if (strcmp(s, "windows") == 0) { - uuid_t win = GPT_ENT_TYPE_MS_BASIC_DATA; + static const uuid_t win = GPT_ENT_TYPE_MS_BASIC_DATA; *uuid = win; return (0); } Index: src/sbin/gpt/migrate.c diff -u src/sbin/gpt/migrate.c:1.6 src/sbin/gpt/migrate.c:1.7 --- src/sbin/gpt/migrate.c:1.6 Sat Apr 13 18:04:33 2013 +++ src/sbin/gpt/migrate.c Sat Apr 13 18:32:01 2013 @@ -29,7 +29,7 @@ __FBSDID("$FreeBSD: src/sbin/gpt/migrate.c,v 1.16 2005/09/01 02:42:52 marcel Exp $"); #endif #ifdef __RCSID -__RCSID("$NetBSD: migrate.c,v 1.6 2013/04/13 18:04:33 jakllsch Exp $"); +__RCSID("$NetBSD: migrate.c,v 1.7 2013/04/13 18:32:01 jakllsch Exp $"); #endif #include @@ -106,21 +106,21 @@ migrate_disklabel(int fd, off_t start, s case FS_UNUSED: continue; case FS_SWAP: { - uuid_t swap = GPT_ENT_TYPE_FREEBSD_SWAP; + static const uuid_t swap = GPT_ENT_TYPE_FREEBSD_SWAP; le_uuid_enc(ent->ent_type, &swap); utf8_to_utf16((const uint8_t *)"FreeB
CVS commit: othersrc/share/examples/ec2/files
Module Name:othersrc Committed By: riz Date: Sat Apr 13 19:16:22 UTC 2013 Modified Files: othersrc/share/examples/ec2/files: bootstrap.sh Log Message: Add an 'xsets' option to install all the X11 sets. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 othersrc/share/examples/ec2/files/bootstrap.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: othersrc/share/examples/ec2/files/bootstrap.sh diff -u othersrc/share/examples/ec2/files/bootstrap.sh:1.3 othersrc/share/examples/ec2/files/bootstrap.sh:1.4 --- othersrc/share/examples/ec2/files/bootstrap.sh:1.3 Sun Mar 17 17:21:14 2013 +++ othersrc/share/examples/ec2/files/bootstrap.sh Sat Apr 13 19:16:21 2013 @@ -6,7 +6,7 @@ PKGIN_CONF="/usr/pkg/etc/pkgin/repositor usage() { - echo "Usage: ${0##*/} [src|pkgsrc|binpkg|xbase]" + echo "Usage: ${0##*/} [src|pkgsrc|binpkg|xbase|xsets]" exit } @@ -55,6 +55,17 @@ xbase) tar -xzpf xbase.tgz -C / rm -f xbase.tgz ;; +xsets) + echo "Downloading and installing X11 sets..." + xsets="xbase.tgz xcomp.tgz xetc.tgz xfont.tgz xserver.tgz" + for set in ${xsets} ; do + echo "Downloading ${set}..." + ftp -a "$URLROOT/NetBSD/NetBSD-$(uname -r)/$(uname -m)/binary/sets/${set}" + echo "Extracting ${set}" + tar -xzpf ${set} -C / + rm -f ${set} + done + ;; *) usage ;;
CVS commit: src/sbin/fsck
Module Name:src Committed By: jakllsch Date: Sat Apr 13 22:08:58 UTC 2013 Modified Files: src/sbin/fsck: partutil.c Log Message: Make getdiskinfo() always return correct dkwedge_info for the raw partition. A real disk's raw partition does not implement DIOCGWEDGEINFO, but does implement DIOCGDINFO. This was resulting in the returned wedge information containing 32-bit-clamped values for size of the raw partition, with no indication thereof. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sbin/fsck/partutil.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/fsck/partutil.c diff -u src/sbin/fsck/partutil.c:1.11 src/sbin/fsck/partutil.c:1.12 --- src/sbin/fsck/partutil.c:1.11 Sun Nov 13 22:04:51 2011 +++ src/sbin/fsck/partutil.c Sat Apr 13 22:08:57 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: partutil.c,v 1.11 2011/11/13 22:04:51 christos Exp $ */ +/* $NetBSD: partutil.c,v 1.12 2013/04/13 22:08:57 jakllsch Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__RCSID("$NetBSD: partutil.c,v 1.11 2011/11/13 22:04:51 christos Exp $"); +__RCSID("$NetBSD: partutil.c,v 1.12 2013/04/13 22:08:57 jakllsch Exp $"); #include #include @@ -89,30 +89,6 @@ dict2geom(struct disk_geom *geo, prop_di } -static void -part2wedge(struct dkwedge_info *dkw, const struct disklabel *lp, const char *s) -{ - struct stat sb; - const struct partition *pp; - int ptn; - - (void)memset(dkw, 0, sizeof(*dkw)); - if (stat(s, &sb) == -1) - return; - - ptn = strchr(s, '\0')[-1] - 'a'; - if ((unsigned)ptn >= lp->d_npartitions || - (devminor_t)ptn != DISKPART(sb.st_rdev)) - return; - - pp = &lp->d_partitions[ptn]; - dkw->dkw_offset = pp->p_offset; - dkw->dkw_size = pp->p_size; - dkw->dkw_parent[0] = '*'; - strlcpy(dkw->dkw_ptype, getfstypename(pp->p_fstype), - sizeof(dkw->dkw_ptype)); -} - int getdiskinfo(const char *s, int fd, const char *dt, struct disk_geom *geo, struct dkwedge_info *dkw) @@ -120,6 +96,9 @@ getdiskinfo(const char *s, int fd, const struct disklabel lab; struct disklabel *lp = &lab; prop_dictionary_t disk_dict, geom_dict; + struct stat sb; + const struct partition *pp; + int ptn; if (dt) { lp = getdiskbyname(dt); @@ -144,15 +123,41 @@ getdiskinfo(const char *s, int fd, const geom_dict = prop_dictionary_get(disk_dict, "geometry"); dict2geom(geo, geom_dict); } - + /* Get info about partition/wedge */ - if (ioctl(fd, DIOCGWEDGEINFO, dkw) == -1) { - if (ioctl(fd, DIOCGDINFO, lp) == -1) - err(1, "Please implement DIOCGWEDGEINFO or " - "DIOCGDINFO for disk device %s", s); + if (ioctl(fd, DIOCGWEDGEINFO, dkw) != -1) { + /* DIOCGWEDGEINFO didn't fail, we're done */ + return 0; + } + + if (ioctl(fd, DIOCGDINFO, lp) == -1) { + err(1, "Please implement DIOCGWEDGEINFO or " + "DIOCGDINFO for disk device %s", s); + } + + /* DIOCGDINFO didn't fail */ + + (void)memset(dkw, 0, sizeof(*dkw)); + + if (stat(s, &sb) == -1) + return 0; + + ptn = strchr(s, '\0')[-1] - 'a'; + if ((unsigned)ptn >= lp->d_npartitions || + (devminor_t)ptn != DISKPART(sb.st_rdev)) + return 0; - part2wedge(dkw, lp, s); + pp = &lp->d_partitions[ptn]; + if (ptn != getrawpartition()) { + dkw->dkw_offset = pp->p_offset; + dkw->dkw_size = pp->p_size; + } else { + dkw->dkw_offset = 0; + dkw->dkw_size = geo->dg_secperunit; } + dkw->dkw_parent[0] = '*'; + strlcpy(dkw->dkw_ptype, getfstypename(pp->p_fstype), + sizeof(dkw->dkw_ptype)); return 0; }
CVS commit: src/external/bsd/dhcp/dist/server
Module Name:src Committed By: christos Date: Sat Apr 13 23:04:35 UTC 2013 Modified Files: src/external/bsd/dhcp/dist/server: dhcpd.c Log Message: How could this possibly ever have worked with threads? It forked *after* it initialized the isc library and the parent having created the threads exited with the worker threads?!?!? Only -d worked because it did not fork! To generate a diff of this commit: cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/dhcp/dist/server/dhcpd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/dhcp/dist/server/dhcpd.c diff -u src/external/bsd/dhcp/dist/server/dhcpd.c:1.1.1.2 src/external/bsd/dhcp/dist/server/dhcpd.c:1.2 --- src/external/bsd/dhcp/dist/server/dhcpd.c:1.1.1.2 Sun Mar 24 18:50:40 2013 +++ src/external/bsd/dhcp/dist/server/dhcpd.c Sat Apr 13 19:04:35 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: dhcpd.c,v 1.1.1.2 2013/03/24 22:50:40 christos Exp $ */ +/* $NetBSD: dhcpd.c,v 1.2 2013/04/13 23:04:35 christos Exp $ */ /* dhcpd.c @@ -35,7 +35,7 @@ */ #include -__RCSID("$NetBSD: dhcpd.c,v 1.1.1.2 2013/03/24 22:50:40 christos Exp $"); +__RCSID("$NetBSD: dhcpd.c,v 1.2 2013/04/13 23:04:35 christos Exp $"); static const char copyright[] = "Copyright 2004-2013 Internet Systems Consortium."; @@ -287,27 +287,6 @@ main(int argc, char **argv) { else if (fd != -1) close(fd); - /* Set up the isc and dns library managers */ - status = dhcp_context_create(); - if (status != ISC_R_SUCCESS) - log_fatal("Can't initialize context: %s", - isc_result_totext(status)); - - /* Set up the client classification system. */ - classification_setup (); - - /* Initialize the omapi system. */ - result = omapi_init (); - if (result != ISC_R_SUCCESS) - log_fatal ("Can't initialize OMAPI: %s", - isc_result_totext (result)); - - /* Set up the OMAPI wrappers for common objects. */ - dhcp_db_objects_setup (); - /* Set up the OMAPI wrappers for various server database internal - objects. */ - dhcp_common_objects_setup (); - /* Initially, log errors to stderr as well as to syslogd. */ openlog ("dhcpd", LOG_NDELAY, DHCPD_LOG_FACILITY); @@ -488,6 +467,40 @@ main(int argc, char **argv) { quiet = 0; log_perror = 0; } +#ifndef DEBUG + /* + * We need to fork before we call the context create + * call that creates the worker threads! + */ + if (daemon) { + /* First part of becoming a daemon... */ + if ((pid = fork ()) < 0) + log_fatal ("Can't fork daemon: %m"); + else if (pid) + exit (0); + } +#endif + + /* Set up the isc and dns library managers */ + status = dhcp_context_create(); + if (status != ISC_R_SUCCESS) + log_fatal("Can't initialize context: %s", + isc_result_totext(status)); + + /* Set up the client classification system. */ + classification_setup (); + + /* Initialize the omapi system. */ + result = omapi_init (); + if (result != ISC_R_SUCCESS) + log_fatal ("Can't initialize OMAPI: %s", + isc_result_totext (result)); + + /* Set up the OMAPI wrappers for common objects. */ + dhcp_db_objects_setup (); + /* Set up the OMAPI wrappers for various server database internal + objects. */ + dhcp_common_objects_setup (); #if defined (TRACING) trace_init (set_time, MDL); @@ -770,13 +783,6 @@ main(int argc, char **argv) { #endif /* DHCPv6 */ #ifndef DEBUG - if (daemon) { - /* First part of becoming a daemon... */ - if ((pid = fork ()) < 0) - log_fatal ("Can't fork daemon: %m"); - else if (pid) - exit (0); - } #if defined (PARANOIA) /* change uid to the specified one */
CVS commit: src/external/bsd/dhcp/dist/server
Module Name:src Committed By: christos Date: Sun Apr 14 01:51:39 UTC 2013 Modified Files: src/external/bsd/dhcp/dist/server: dhcpd.c Log Message: initialize the omapi subsystem early so we can allocate interfaces. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/bsd/dhcp/dist/server/dhcpd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/dhcp/dist/server/dhcpd.c diff -u src/external/bsd/dhcp/dist/server/dhcpd.c:1.2 src/external/bsd/dhcp/dist/server/dhcpd.c:1.3 --- src/external/bsd/dhcp/dist/server/dhcpd.c:1.2 Sat Apr 13 19:04:35 2013 +++ src/external/bsd/dhcp/dist/server/dhcpd.c Sat Apr 13 21:51:39 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: dhcpd.c,v 1.2 2013/04/13 23:04:35 christos Exp $ */ +/* $NetBSD: dhcpd.c,v 1.3 2013/04/14 01:51:39 christos Exp $ */ /* dhcpd.c @@ -35,7 +35,7 @@ */ #include -__RCSID("$NetBSD: dhcpd.c,v 1.2 2013/04/13 23:04:35 christos Exp $"); +__RCSID("$NetBSD: dhcpd.c,v 1.3 2013/04/14 01:51:39 christos Exp $"); static const char copyright[] = "Copyright 2004-2013 Internet Systems Consortium."; @@ -287,6 +287,18 @@ main(int argc, char **argv) { else if (fd != -1) close(fd); + /* Initialize the omapi system. */ + result = omapi_init (); + if (result != ISC_R_SUCCESS) + log_fatal ("Can't initialize OMAPI: %s", + isc_result_totext (result)); + + /* Set up the OMAPI wrappers for common objects. */ + dhcp_db_objects_setup (); + /* Set up the OMAPI wrappers for various server database internal + objects. */ + dhcp_common_objects_setup (); + /* Initially, log errors to stderr as well as to syslogd. */ openlog ("dhcpd", LOG_NDELAY, DHCPD_LOG_FACILITY); @@ -489,19 +501,6 @@ main(int argc, char **argv) { /* Set up the client classification system. */ classification_setup (); - - /* Initialize the omapi system. */ - result = omapi_init (); - if (result != ISC_R_SUCCESS) - log_fatal ("Can't initialize OMAPI: %s", - isc_result_totext (result)); - - /* Set up the OMAPI wrappers for common objects. */ - dhcp_db_objects_setup (); - /* Set up the OMAPI wrappers for various server database internal - objects. */ - dhcp_common_objects_setup (); - #if defined (TRACING) trace_init (set_time, MDL); if (traceoutfile) {