part.c (323050) | part.c (328889) |
---|---|
1/*- 2 * Copyright (c) 2012 Andrey V. Elsukov <ae@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2012 Andrey V. Elsukov <ae@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: stable/11/sys/boot/common/part.c 323050 2017-08-31 12:36:09Z oleg $"); | 28__FBSDID("$FreeBSD: stable/11/sys/boot/common/part.c 328889 2018-02-05 17:01:18Z kevans $"); |
29 30#include <stand.h> 31#include <sys/param.h> 32#include <sys/diskmbr.h> 33#include <sys/disklabel.h> 34#include <sys/endian.h> 35#include <sys/gpt.h> 36#include <sys/stddef.h> --- 793 unchanged lines hidden (view full) --- 830 return (ENOENT); 831} 832 833int 834ptable_iterate(const struct ptable *table, void *arg, ptable_iterate_t *iter) 835{ 836 struct pentry *entry; 837 char name[32]; | 29 30#include <stand.h> 31#include <sys/param.h> 32#include <sys/diskmbr.h> 33#include <sys/disklabel.h> 34#include <sys/endian.h> 35#include <sys/gpt.h> 36#include <sys/stddef.h> --- 793 unchanged lines hidden (view full) --- 830 return (ENOENT); 831} 832 833int 834ptable_iterate(const struct ptable *table, void *arg, ptable_iterate_t *iter) 835{ 836 struct pentry *entry; 837 char name[32]; |
838 int ret = 0; |
|
838 839 name[0] = '\0'; 840 STAILQ_FOREACH(entry, &table->entries, entry) { 841#ifdef LOADER_MBR_SUPPORT 842 if (table->type == PTABLE_MBR) 843 sprintf(name, "s%d", entry->part.index); 844 else 845#endif --- 6 unchanged lines hidden (view full) --- 852 if (table->type == PTABLE_VTOC8) 853 sprintf(name, "%c", (u_char) 'a' + 854 entry->part.index); 855 else 856#endif 857 if (table->type == PTABLE_BSD) 858 sprintf(name, "%c", (u_char) 'a' + 859 entry->part.index); | 839 840 name[0] = '\0'; 841 STAILQ_FOREACH(entry, &table->entries, entry) { 842#ifdef LOADER_MBR_SUPPORT 843 if (table->type == PTABLE_MBR) 844 sprintf(name, "s%d", entry->part.index); 845 else 846#endif --- 6 unchanged lines hidden (view full) --- 853 if (table->type == PTABLE_VTOC8) 854 sprintf(name, "%c", (u_char) 'a' + 855 entry->part.index); 856 else 857#endif 858 if (table->type == PTABLE_BSD) 859 sprintf(name, "%c", (u_char) 'a' + 860 entry->part.index); |
860 if (iter(arg, name, &entry->part)) 861 return 1; | 861 if ((ret = iter(arg, name, &entry->part)) != 0) 862 return (ret); |
862 } | 863 } |
863 return 0; | 864 return (ret); |
864} | 865} |
865 | |