svn commit: r308434 - in head: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/mips/beri/loader sys/boot/ofw/libofw sys...

Warner Losh imp at bsdimp.com
Fri Nov 11 17:24:15 UTC 2016


On Fri, Nov 11, 2016 at 10:20 AM, Toomas Soome <tsoome at me.com> wrote:
>
>> On 11. nov 2016, at 19:08, Warner Losh <imp at bsdimp.com> wrote:
>>
>> This suggests we've created an update / upgrade problem. Do we?
>>
>> Warner
>
>
> Not if the normal build suggestion (make buildworld buildkernel) is followed, as then the headers from the source tree are put in proper place as part of the build procedure - in this case the source was fetched by svn update and attempt was made to build part of the fetched tree.
>
> In that sense, I don’t see the problem, as direct build without scene setup is not really supported. Or am I wrong? The same issue will happen with any header change, as you can not really build new source with using old headers.

OK. Nah, this is cool. libstand's API is somewhat unstable and not
needed in the upgrade path.

Warner

> rgds,
> toomas
>
>>
>> On Thu, Nov 10, 2016 at 11:52 PM, Kamil Czekirda <kczekirda at gmail.com> wrote:
>>> cp /usr/src/lib/libstand/libstand.h /usr/include/stand.h fixed that
>>>
>>> thanks
>>>
>>> 2016-11-10 23:28 GMT+01:00 Toomas Soome <tsoome at me.com>:
>>>>
>>>> the patch does update the lib/libstand/stand.h to have:
>>>>
>>>> struct devsw {
>>>> . . .
>>>> int         (*dv_print)(int verbose);
>>>>
>>>> it was void before; from your svnlite log I can see the
>>>> lib/libstand/stand.h is updated, could you confirm if it is int now? if it
>>>> is, I suspect the build is getting the old stand.h from somewhere in the
>>>> tree and not your <source>/lib/libstand.
>>>>
>>>> if so, does the build has target to copy headers in place? I’m sorry, I
>>>> don't know all the tricks the build system does as part of the buildworld..
>>>>
>>>> rgds,
>>>> toomas
>>>>
>>>>
>>>> On 11. nov 2016, at 0:21, Kamil Czekirda <kczekirda at gmail.com> wrote:
>>>>
>>>> Hi,
>>>>
>>>> I got the following:
>>>>
>>>> root at current:/usr/src # svnlite up -r r308434
>>>> Updating '.':
>>>> U    lib/libstand/stand.h
>>>> U    sys/boot/common/dev_net.c
>>>> U    sys/boot/common/module.c
>>>> U    sys/boot/common/part.c
>>>> U    sys/boot/common/util.c
>>>> U    sys/boot/common/util.h
>>>> U    sys/boot/efi/libefi/efinet.c
>>>> U    sys/boot/efi/libefi/efipart.c
>>>> U    sys/boot/efi/loader/main.c
>>>> U    sys/boot/i386/libfirewire/firewire.c
>>>> U    sys/boot/i386/libi386/bioscd.c
>>>> U    sys/boot/i386/libi386/biosdisk.c
>>>> U    sys/boot/mips/beri/loader/beri_disk_cfi.c
>>>> U    sys/boot/mips/beri/loader/beri_disk_sdcard.c
>>>> U    sys/boot/ofw/libofw/ofw_disk.c
>>>> U    sys/boot/pc98/libpc98/bioscd.c
>>>> U    sys/boot/pc98/libpc98/biosdisk.c
>>>> U    sys/boot/powerpc/kboot/hostdisk.c
>>>> U    sys/boot/powerpc/ps3/ps3cdrom.c
>>>> U    sys/boot/powerpc/ps3/ps3disk.c
>>>> U    sys/boot/uboot/lib/disk.c
>>>> U    sys/boot/usb/storage/umass_loader.c
>>>> U    sys/boot/userboot/userboot/host.c
>>>> U    sys/boot/userboot/userboot/userboot_disk.c
>>>> U    sys/boot/zfs/zfs.c
>>>> U    sys/boot/zfs/zfsimpl.c
>>>> U    sys/boot/i386/libi386/pxe.c
>>>> Updated to revision 308434.
>>>> root at current:/usr/src # cd sys/boot/
>>>> root at current:/usr/src/sys/boot # make clean
>>>> (...)
>>>> root at current:/usr/src/sys/boot # make obj
>>>> (...)
>>>> root at current:/usr/src/sys/boot # make
>>>> (...)
>>>> cc  -O2 -pipe   -DSKEIN_LOOP=111 -fPIC -I/usr/src/sys/boot/efi/loader
>>>> -I/usr/src/sys/boot/efi/loader/arch/amd64
>>>> -I/usr/src/sys/boot/efi/loader/../include
>>>> -I/usr/src/sys/boot/efi/loader/../include/amd64
>>>> -I/usr/src/sys/boot/efi/loader/../../../contrib/dev/acpica/include
>>>> -I/usr/src/sys/boot/efi/loader/../../..
>>>> -I/usr/src/sys/boot/efi/loader/../../i386/libi386
>>>> -I/usr/src/sys/boot/efi/loader/../../zfs
>>>> -I/usr/src/sys/boot/efi/loader/../../../cddl/boot/zfs
>>>> -I/usr/src/sys/boot/efi/loader/../../../crypto/skein -DEFI_ZFS_BOOT -DNO_PCI
>>>> -DEFI -DSMBIOS_SERIAL_NUMBERS -DBOOT_FORTH
>>>> -I/usr/src/sys/boot/efi/loader/../../ficl
>>>> -I/usr/src/sys/boot/efi/loader/../../ficl/amd64 -DLOADER_DISK_SUPPORT
>>>> -DLOADER_GPT_SUPPORT -DLOADER_MBR_SUPPORT -fPIC -I/usr/src/sys/boot/ficl
>>>> -I/usr/src/sys/boot/ficl/amd64  -I/usr/src/sys/boot/ficl/../common
>>>> -I/usr/src/sys/boot/efi/loader/../../common -ffreestanding -Wformat
>>>> -msoft-float -mno-mmx -mno-sse -mno-avx -fshort-wchar -mno-red-zone -mno-aes
>>>> -g -MD  -MF.depend.vers.o -MTvers.o -std=gnu99 -Wsystem-headers -Werror
>>>> -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes
>>>> -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign
>>>> -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable
>>>> -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality
>>>> -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef
>>>> -Qunused-arguments  -c vers.c -o vers.o
>>>> cc  -O2 -pipe   -DSKEIN_LOOP=111 -fPIC -I/usr/src/sys/boot/efi/loader
>>>> -I/usr/src/sys/boot/efi/loader/arch/amd64
>>>> -I/usr/src/sys/boot/efi/loader/../include
>>>> -I/usr/src/sys/boot/efi/loader/../include/amd64
>>>> -I/usr/src/sys/boot/efi/loader/../../../contrib/dev/acpica/include
>>>> -I/usr/src/sys/boot/efi/loader/../../..
>>>> -I/usr/src/sys/boot/efi/loader/../../i386/libi386
>>>> -I/usr/src/sys/boot/efi/loader/../../zfs
>>>> -I/usr/src/sys/boot/efi/loader/../../../cddl/boot/zfs
>>>> -I/usr/src/sys/boot/efi/loader/../../../crypto/skein -DEFI_ZFS_BOOT -DNO_PCI
>>>> -DEFI -DSMBIOS_SERIAL_NUMBERS -DBOOT_FORTH
>>>> -I/usr/src/sys/boot/efi/loader/../../ficl
>>>> -I/usr/src/sys/boot/efi/loader/../../ficl/amd64 -DLOADER_DISK_SUPPORT
>>>> -DLOADER_GPT_SUPPORT -DLOADER_MBR_SUPPORT -fPIC -I/usr/src/sys/boot/ficl
>>>> -I/usr/src/sys/boot/ficl/amd64  -I/usr/src/sys/boot/ficl/../common
>>>> -I/usr/src/sys/boot/efi/loader/../../common -ffreestanding -Wformat
>>>> -msoft-float -mno-mmx -mno-sse -mno-avx -fshort-wchar -mno-red-zone -mno-aes
>>>> -g -MD  -MF.depend.zfs.o -MTzfs.o -std=gnu99 -Wsystem-headers -Werror -Wall
>>>> -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes
>>>> -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign
>>>> -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable
>>>> -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality
>>>> -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef
>>>> -Wno-sign-compare -Wno-array-bounds -Wno-missing-prototypes
>>>> -Qunused-arguments  -c /usr/src/sys/boot/efi/loader/../../zfs/zfs.c -o zfs.o
>>>> /usr/src/sys/boot/efi/loader/../../zfs/zfs.c:599:14: error: incompatible
>>>> pointer types initializing 'void (*)(int)' with an expression of type 'int
>>>> (int)' [-Werror,-Wincompatible-pointer-types]
>>>>        .dv_print = zfs_dev_print,
>>>>                    ^~~~~~~~~~~~~
>>>> 1 error generated.
>>>> *** Error code 1
>>>>
>>>> Stop.
>>>> make[2]: stopped in /usr/src/sys/boot/efi/loader
>>>> *** Error code 1
>>>>
>>>> Stop.
>>>> make[1]: stopped in /usr/src/sys/boot/efi
>>>> *** Error code 1
>>>>
>>>> Stop.
>>>> make: stopped in /usr/src/sys/boot
>>>>
>>>>
>>>> Kamil
>>>>
>>>> 2016-11-08 7:50 GMT+01:00 Toomas Soome <tsoome at freebsd.org>:
>>>>>
>>>>> Author: tsoome
>>>>> Date: Tue Nov  8 06:50:18 2016
>>>>> New Revision: 308434
>>>>> URL: https://svnweb.freebsd.org/changeset/base/308434
>>>>>
>>>>> Log:
>>>>>  Loader paged/pageable data is not always paged.
>>>>>
>>>>>  This change does modify devsw dv_print() to return the int value,
>>>>>  enabling walkers to interrupt the walk on non zero value from
>>>>> dv_print().
>>>>>
>>>>>  This will allow the pager_print actually to stop displaying data on
>>>>>  user input, and additionally pager is used in various *dev_print
>>>>> callbacks,
>>>>>  where it was missing.
>>>>>
>>>>>  For test, lsdev [-v] command should display data by screenfuls and
>>>>> should
>>>>>  stop when the key 'q' is pressed on pager prompt.
>>>>>
>>>>>  Reviewed by:  allanjude
>>>>>  Approved by:  allanjude (mentor)
>>>>>  Differential Revision:        https://reviews.freebsd.org/D5461
>>>>>
>>>>> Modified:
>>>>>  head/lib/libstand/stand.h
>>>>>  head/sys/boot/common/dev_net.c
>>>>>  head/sys/boot/common/module.c
>>>>>  head/sys/boot/common/part.c
>>>>>  head/sys/boot/common/util.c
>>>>>  head/sys/boot/common/util.h
>>>>>  head/sys/boot/efi/libefi/efinet.c
>>>>>  head/sys/boot/efi/libefi/efipart.c
>>>>>  head/sys/boot/efi/loader/main.c
>>>>>  head/sys/boot/i386/libfirewire/firewire.c
>>>>>  head/sys/boot/i386/libi386/bioscd.c
>>>>>  head/sys/boot/i386/libi386/biosdisk.c
>>>>>  head/sys/boot/i386/libi386/pxe.c
>>>>>  head/sys/boot/mips/beri/loader/beri_disk_cfi.c
>>>>>  head/sys/boot/mips/beri/loader/beri_disk_sdcard.c
>>>>>  head/sys/boot/ofw/libofw/ofw_disk.c
>>>>>  head/sys/boot/pc98/libpc98/bioscd.c
>>>>>  head/sys/boot/pc98/libpc98/biosdisk.c
>>>>>  head/sys/boot/powerpc/kboot/hostdisk.c
>>>>>  head/sys/boot/powerpc/ps3/ps3cdrom.c
>>>>>  head/sys/boot/powerpc/ps3/ps3disk.c
>>>>>  head/sys/boot/uboot/lib/disk.c
>>>>>  head/sys/boot/usb/storage/umass_loader.c
>>>>>  head/sys/boot/userboot/userboot/host.c
>>>>>  head/sys/boot/userboot/userboot/userboot_disk.c
>>>>>  head/sys/boot/zfs/zfs.c
>>>>>  head/sys/boot/zfs/zfsimpl.c
>>>>>
>>>>> Modified: head/lib/libstand/stand.h
>>>>>
>>>>> ==============================================================================
>>>>> --- head/lib/libstand/stand.h   Tue Nov  8 06:13:22 2016        (r308433)
>>>>> +++ head/lib/libstand/stand.h   Tue Nov  8 06:50:18 2016        (r308434)
>>>>> @@ -143,7 +143,7 @@ struct devsw {
>>>>>     int                (*dv_open)(struct open_file *f, ...);
>>>>>     int                (*dv_close)(struct open_file *f);
>>>>>     int                (*dv_ioctl)(struct open_file *f, u_long cmd, void
>>>>> *data);
>>>>> -    void       (*dv_print)(int verbose);       /* print device
>>>>> information */
>>>>> +    int                (*dv_print)(int verbose);       /* print device
>>>>> information */
>>>>>     void       (*dv_cleanup)(void);
>>>>> };
>>>>>
>>>>>
>>>>> Modified: head/sys/boot/common/dev_net.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/common/dev_net.c      Tue Nov  8 06:13:22 2016
>>>>> (r308433)
>>>>> +++ head/sys/boot/common/dev_net.c      Tue Nov  8 06:50:18 2016
>>>>> (r308434)
>>>>> @@ -80,7 +80,7 @@ static int    net_open(struct open_file *,
>>>>> static int     net_close(struct open_file *);
>>>>> static void    net_cleanup(void);
>>>>> static int     net_strategy();
>>>>> -static void    net_print(int);
>>>>> +static int     net_print(int);
>>>>>
>>>>> static int net_getparams(int sock);
>>>>>
>>>>> @@ -325,23 +325,27 @@ exit:
>>>>>        return (0);
>>>>> }
>>>>>
>>>>> -static void
>>>>> +static int
>>>>> net_print(int verbose)
>>>>> {
>>>>>        struct netif_driver *drv;
>>>>>        int i, d, cnt;
>>>>> +       int ret = 0;
>>>>>
>>>>>        cnt = 0;
>>>>>        for (d = 0; netif_drivers[d]; d++) {
>>>>>                drv = netif_drivers[d];
>>>>>                for (i = 0; i < drv->netif_nifs; i++) {
>>>>>                        printf("\t%s%d:", "net", cnt++);
>>>>> -                       if (verbose)
>>>>> +                       if (verbose) {
>>>>>                                printf(" (%s%d)", drv->netif_bname,
>>>>>                                    drv->netif_ifs[i].dif_unit);
>>>>> +                       }
>>>>> +                       if ((ret = pager_output("\n")) != 0)
>>>>> +                               return (ret);
>>>>>                }
>>>>>        }
>>>>> -       printf("\n");
>>>>> +       return (ret);
>>>>> }
>>>>>
>>>>> /*
>>>>>
>>>>> Modified: head/sys/boot/common/module.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/common/module.c       Tue Nov  8 06:13:22 2016
>>>>> (r308433)
>>>>> +++ head/sys/boot/common/module.c       Tue Nov  8 06:50:18 2016
>>>>> (r308434)
>>>>> @@ -254,7 +254,7 @@ command_lsmod(int argc, char *argv[])
>>>>>     struct kernel_module       *mp;
>>>>>     struct file_metadata       *md;
>>>>>     char                       lbuf[80];
>>>>> -    int                                ch, verbose;
>>>>> +    int                                ch, verbose, ret = 0;
>>>>>
>>>>>     verbose = 0;
>>>>>     optind = 1;
>>>>> @@ -273,11 +273,13 @@ command_lsmod(int argc, char *argv[])
>>>>>
>>>>>     pager_open();
>>>>>     for (fp = preloaded_files; fp; fp = fp->f_next) {
>>>>> -       sprintf(lbuf, " %p: ", (void *) fp->f_addr);
>>>>> +       snprintf(lbuf, sizeof(lbuf), " %p: ", (void *) fp->f_addr);
>>>>>        pager_output(lbuf);
>>>>>        pager_output(fp->f_name);
>>>>> -       sprintf(lbuf, " (%s, 0x%lx)\n", fp->f_type, (long)fp->f_size);
>>>>> -       pager_output(lbuf);
>>>>> +       snprintf(lbuf, sizeof(lbuf), " (%s, 0x%lx)\n", fp->f_type,
>>>>> +           (long)fp->f_size);
>>>>> +       if (pager_output(lbuf))
>>>>> +           break;
>>>>>        if (fp->f_args != NULL) {
>>>>>            pager_output("    args: ");
>>>>>            pager_output(fp->f_args);
>>>>> @@ -287,7 +289,8 @@ command_lsmod(int argc, char *argv[])
>>>>>        if (fp->f_modules) {
>>>>>            pager_output("  modules: ");
>>>>>            for (mp = fp->f_modules; mp; mp = mp->m_next) {
>>>>> -               sprintf(lbuf, "%s.%d ", mp->m_name, mp->m_version);
>>>>> +               snprintf(lbuf, sizeof(lbuf), "%s.%d ", mp->m_name,
>>>>> +                   mp->m_version);
>>>>>                pager_output(lbuf);
>>>>>            }
>>>>>            if (pager_output("\n"))
>>>>> @@ -296,11 +299,14 @@ command_lsmod(int argc, char *argv[])
>>>>>        if (verbose) {
>>>>>            /* XXX could add some formatting smarts here to display some
>>>>> better */
>>>>>            for (md = fp->f_metadata; md != NULL; md = md->md_next) {
>>>>> -               sprintf(lbuf, "      0x%04x, 0x%lx\n", md->md_type,
>>>>> (long) md->md_size);
>>>>> +               snprintf(lbuf, sizeof(lbuf), "      0x%04x, 0x%lx\n",
>>>>> +                   md->md_type, (long) md->md_size);
>>>>>                if (pager_output(lbuf))
>>>>>                        break;
>>>>>            }
>>>>>        }
>>>>> +       if (ret)
>>>>> +           break;
>>>>>     }
>>>>>     pager_close();
>>>>>     return(CMD_OK);
>>>>>
>>>>> Modified: head/sys/boot/common/part.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/common/part.c Tue Nov  8 06:13:22 2016        (r308433)
>>>>> +++ head/sys/boot/common/part.c Tue Nov  8 06:50:18 2016        (r308434)
>>>>> @@ -834,6 +834,7 @@ ptable_iterate(const struct ptable *tabl
>>>>> {
>>>>>        struct pentry *entry;
>>>>>        char name[32];
>>>>> +       int ret = 0;
>>>>>
>>>>>        name[0] = '\0';
>>>>>        STAILQ_FOREACH(entry, &table->entries, entry) {
>>>>> @@ -856,9 +857,8 @@ ptable_iterate(const struct ptable *tabl
>>>>>                if (table->type == PTABLE_BSD)
>>>>>                        sprintf(name, "%c", (u_char) 'a' +
>>>>>                            entry->part.index);
>>>>> -               if (iter(arg, name, &entry->part))
>>>>> -                       return 1;
>>>>> +               if ((ret = iter(arg, name, &entry->part)) != 0)
>>>>> +                       return (ret);
>>>>>        }
>>>>> -       return 0;
>>>>> +       return (ret);
>>>>> }
>>>>> -
>>>>>
>>>>> Modified: head/sys/boot/common/util.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/common/util.c Tue Nov  8 06:13:22 2016        (r308433)
>>>>> +++ head/sys/boot/common/util.c Tue Nov  8 06:50:18 2016        (r308434)
>>>>> @@ -114,7 +114,7 @@ strlen(const char *s)
>>>>>        return (len);
>>>>> }
>>>>>
>>>>> -void
>>>>> +int
>>>>> printf(const char *fmt, ...)
>>>>> {
>>>>>        va_list ap;
>>>>> @@ -178,4 +178,5 @@ nextfmt:
>>>>>                }
>>>>>        }
>>>>>        va_end(ap);
>>>>> +       return (0);
>>>>> }
>>>>>
>>>>> Modified: head/sys/boot/common/util.h
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/common/util.h Tue Nov  8 06:13:22 2016        (r308433)
>>>>> +++ head/sys/boot/common/util.h Tue Nov  8 06:50:18 2016        (r308434)
>>>>> @@ -48,6 +48,6 @@ void strcat(char *dst, const char *src);
>>>>> char *strchr(const char *s, char ch);
>>>>> size_t strlen(const char *s);
>>>>>
>>>>> -void printf(const char *fmt, ...);
>>>>> +int printf(const char *fmt, ...);
>>>>>
>>>>> #endif /* !_UTIL_H_ */
>>>>>
>>>>> Modified: head/sys/boot/efi/libefi/efinet.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/efi/libefi/efinet.c   Tue Nov  8 06:13:22 2016
>>>>> (r308433)
>>>>> +++ head/sys/boot/efi/libefi/efinet.c   Tue Nov  8 06:50:18 2016
>>>>> (r308434)
>>>>> @@ -252,7 +252,7 @@ efinet_end(struct netif *nif)
>>>>> }
>>>>>
>>>>> static int efinet_dev_init(void);
>>>>> -static void efinet_dev_print(int);
>>>>> +static int efinet_dev_print(int);
>>>>>
>>>>> struct devsw efinet_dev = {
>>>>>        .dv_name = "net",
>>>>> @@ -346,14 +346,13 @@ efinet_dev_init()
>>>>>        return (0);
>>>>> }
>>>>>
>>>>> -static void
>>>>> +static int
>>>>> efinet_dev_print(int verbose)
>>>>> {
>>>>>        CHAR16 *text;
>>>>>        EFI_HANDLE h;
>>>>> -       int unit;
>>>>> +       int unit, ret = 0;
>>>>>
>>>>> -       pager_open();
>>>>>        for (unit = 0, h = efi_find_handle(&efinet_dev, 0);
>>>>>            h != NULL; h = efi_find_handle(&efinet_dev, ++unit)) {
>>>>>                printf("    %s%d:", efinet_dev.dv_name, unit);
>>>>> @@ -364,8 +363,8 @@ efinet_dev_print(int verbose)
>>>>>                                efi_free_devpath_name(text);
>>>>>                        }
>>>>>                }
>>>>> -               if (pager_output("\n"))
>>>>> +               if ((ret = pager_output("\n")) != 0)
>>>>>                        break;
>>>>>        }
>>>>> -       pager_close();
>>>>> +       return (ret);
>>>>> }
>>>>>
>>>>> Modified: head/sys/boot/efi/libefi/efipart.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/efi/libefi/efipart.c  Tue Nov  8 06:13:22 2016
>>>>> (r308433)
>>>>> +++ head/sys/boot/efi/libefi/efipart.c  Tue Nov  8 06:50:18 2016
>>>>> (r308434)
>>>>> @@ -47,7 +47,7 @@ static int efipart_realstrategy(void *,
>>>>>     size_t *);
>>>>> static int efipart_open(struct open_file *, ...);
>>>>> static int efipart_close(struct open_file *);
>>>>> -static void efipart_print(int);
>>>>> +static int efipart_print(int);
>>>>>
>>>>> struct devsw efipart_dev = {
>>>>>        .dv_name = "part",
>>>>> @@ -162,7 +162,7 @@ efipart_init(void)
>>>>>        return (err);
>>>>> }
>>>>>
>>>>> -static void
>>>>> +static int
>>>>> efipart_print(int verbose)
>>>>> {
>>>>>        char line[80];
>>>>> @@ -170,28 +170,29 @@ efipart_print(int verbose)
>>>>>        EFI_HANDLE h;
>>>>>        EFI_STATUS status;
>>>>>        u_int unit;
>>>>> +       int ret = 0;
>>>>>
>>>>> -       pager_open();
>>>>>        for (unit = 0, h = efi_find_handle(&efipart_dev, 0);
>>>>>            h != NULL; h = efi_find_handle(&efipart_dev, ++unit)) {
>>>>> -               sprintf(line, "    %s%d:", efipart_dev.dv_name, unit);
>>>>> -               if (pager_output(line))
>>>>> +               snprintf(line, sizeof(line), "    %s%d:",
>>>>> +                   efipart_dev.dv_name, unit);
>>>>> +               if ((ret = pager_output(line)) != 0)
>>>>>                        break;
>>>>>
>>>>>                status = BS->HandleProtocol(h, &blkio_guid, (void
>>>>> **)&blkio);
>>>>>                if (!EFI_ERROR(status)) {
>>>>> -                       sprintf(line, "    %llu blocks",
>>>>> +                       snprintf(line, sizeof(line), "    %llu blocks",
>>>>>                            (unsigned long long)(blkio->Media->LastBlock
>>>>> + 1));
>>>>> -                       if (pager_output(line))
>>>>> +                       if ((ret = pager_output(line)) != 0)
>>>>>                                break;
>>>>>                        if (blkio->Media->RemovableMedia)
>>>>> -                               if (pager_output(" (removable)"))
>>>>> +                               if ((ret = pager_output(" (removable)"))
>>>>> != 0)
>>>>>                                        break;
>>>>>                }
>>>>> -               if (pager_output("\n"))
>>>>> +               if ((ret = pager_output("\n")) != 0)
>>>>>                        break;
>>>>>        }
>>>>> -       pager_close();
>>>>> +       return (ret);
>>>>> }
>>>>>
>>>>> static int
>>>>>
>>>>> Modified: head/sys/boot/efi/loader/main.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/efi/loader/main.c     Tue Nov  8 06:13:22 2016
>>>>> (r308433)
>>>>> +++ head/sys/boot/efi/loader/main.c     Tue Nov  8 06:50:18 2016
>>>>> (r308434)
>>>>> @@ -533,6 +533,7 @@ command_memmap(int argc, char *argv[])
>>>>>        UINT32 dver;
>>>>>        EFI_STATUS status;
>>>>>        int i, ndesc;
>>>>> +       char line[80];
>>>>>        static char *types[] = {
>>>>>            "Reserved",
>>>>>            "LoaderCode",
>>>>> @@ -564,14 +565,19 @@ command_memmap(int argc, char *argv[])
>>>>>        }
>>>>>
>>>>>        ndesc = sz / dsz;
>>>>> -       printf("%23s %12s %12s %8s %4s\n",
>>>>> +       snprintf(line, sizeof(line), "%23s %12s %12s %8s %4s\n",
>>>>>            "Type", "Physical", "Virtual", "#Pages", "Attr");
>>>>> +       pager_open();
>>>>> +       if (pager_output(line)) {
>>>>> +               pager_close();
>>>>> +               return (CMD_OK);
>>>>> +       }
>>>>>
>>>>>        for (i = 0, p = map; i < ndesc;
>>>>>             i++, p = NextMemoryDescriptor(p, dsz)) {
>>>>>                printf("%23s %012jx %012jx %08jx ", types[p->Type],
>>>>> -                  (uintmax_t)p->PhysicalStart,
>>>>> (uintmax_t)p->VirtualStart,
>>>>> -                  (uintmax_t)p->NumberOfPages);
>>>>> +                   (uintmax_t)p->PhysicalStart,
>>>>> (uintmax_t)p->VirtualStart,
>>>>> +                   (uintmax_t)p->NumberOfPages);
>>>>>                if (p->Attribute & EFI_MEMORY_UC)
>>>>>                        printf("UC ");
>>>>>                if (p->Attribute & EFI_MEMORY_WC)
>>>>> @@ -588,9 +594,11 @@ command_memmap(int argc, char *argv[])
>>>>>                        printf("RP ");
>>>>>                if (p->Attribute & EFI_MEMORY_XP)
>>>>>                        printf("XP ");
>>>>> -               printf("\n");
>>>>> +               if (pager_output("\n"))
>>>>> +                       break;
>>>>>        }
>>>>>
>>>>> +       pager_close();
>>>>>        return (CMD_OK);
>>>>> }
>>>>>
>>>>> @@ -612,10 +620,17 @@ guid_to_string(EFI_GUID *guid)
>>>>> static int
>>>>> command_configuration(int argc, char *argv[])
>>>>> {
>>>>> +       char line[80];
>>>>>        UINTN i;
>>>>>
>>>>> -       printf("NumberOfTableEntries=%lu\n",
>>>>> +       snprintf(line, sizeof(line), "NumberOfTableEntries=%lu\n",
>>>>>                (unsigned long)ST->NumberOfTableEntries);
>>>>> +       pager_open();
>>>>> +       if (pager_output(line)) {
>>>>> +               pager_close();
>>>>> +               return (CMD_OK);
>>>>> +       }
>>>>> +
>>>>>        for (i = 0; i < ST->NumberOfTableEntries; i++) {
>>>>>                EFI_GUID *guid;
>>>>>
>>>>> @@ -642,9 +657,13 @@ command_configuration(int argc, char *ar
>>>>>                        printf("FDT Table");
>>>>>                else
>>>>>                        printf("Unknown Table (%s)",
>>>>> guid_to_string(guid));
>>>>> -               printf(" at %p\n",
>>>>> ST->ConfigurationTable[i].VendorTable);
>>>>> +               snprintf(line, sizeof(line), " at %p\n",
>>>>> +                   ST->ConfigurationTable[i].VendorTable);
>>>>> +               if (pager_output(line))
>>>>> +                       break;
>>>>>        }
>>>>>
>>>>> +       pager_close();
>>>>>        return (CMD_OK);
>>>>> }
>>>>>
>>>>>
>>>>> Modified: head/sys/boot/i386/libfirewire/firewire.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/i386/libfirewire/firewire.c   Tue Nov  8 06:13:22 2016
>>>>> (r308433)
>>>>> +++ head/sys/boot/i386/libfirewire/firewire.c   Tue Nov  8 06:50:18 2016
>>>>> (r308434)
>>>>> @@ -69,7 +69,7 @@ static int    fw_strategy(void *devdata, in
>>>>>                    size_t offset, size_t size, char *buf, size_t
>>>>> *rsize);
>>>>> static int     fw_open(struct open_file *f, ...);
>>>>> static int     fw_close(struct open_file *f);
>>>>> -static void    fw_print(int verbose);
>>>>> +static int     fw_print(int verbose);
>>>>> static void    fw_cleanup(void);
>>>>>
>>>>> void           fw_enable(void);
>>>>> @@ -148,21 +148,26 @@ fw_init(void)
>>>>> /*
>>>>>  * Print information about OHCI chips
>>>>>  */
>>>>> -static void
>>>>> +static int
>>>>> fw_print(int verbose)
>>>>> {
>>>>> -       int i;
>>>>> +       char line[80];
>>>>> +       int i, ret = 0;
>>>>>        struct fwohci_softc *sc;
>>>>>
>>>>>        for (i = 0; i < MAX_OHCI; i ++) {
>>>>>                sc = &fwinfo[i];
>>>>>                if (sc->state == FWOHCI_STATE_DEAD)
>>>>>                        break;
>>>>> -               printf("%d: locator=0x%04x devid=0x%08x"
>>>>> +               snprintf(line, sizeof(line), "%d: locator=0x%04x
>>>>> devid=0x%08x"
>>>>>                        " base_addr=0x%08x handle=0x%08x
>>>>> bus_id=0x%08x\n",
>>>>>                        i, sc->locator, sc->devid,
>>>>>                        sc->base_addr, sc->handle, sc->bus_id);
>>>>> +               ret = pager_output(line);
>>>>> +               if (ret != 0)
>>>>> +                       break;
>>>>>        }
>>>>> +       return (ret);
>>>>> }
>>>>>
>>>>> static int
>>>>>
>>>>> Modified: head/sys/boot/i386/libi386/bioscd.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/i386/libi386/bioscd.c Tue Nov  8 06:13:22 2016
>>>>> (r308433)
>>>>> +++ head/sys/boot/i386/libi386/bioscd.c Tue Nov  8 06:50:18 2016
>>>>> (r308434)
>>>>> @@ -100,7 +100,7 @@ static int  bc_realstrategy(void *devdata
>>>>>     size_t offset, size_t size, char *buf, size_t *rsize);
>>>>> static int     bc_open(struct open_file *f, ...);
>>>>> static int     bc_close(struct open_file *f);
>>>>> -static void    bc_print(int verbose);
>>>>> +static int     bc_print(int verbose);
>>>>>
>>>>> struct devsw bioscd = {
>>>>>        "cd",
>>>>> @@ -177,20 +177,19 @@ bc_add(int biosdev)
>>>>> /*
>>>>>  * Print information about disks
>>>>>  */
>>>>> -static void
>>>>> +static int
>>>>> bc_print(int verbose)
>>>>> {
>>>>>        char line[80];
>>>>> -       int i;
>>>>> +       int i, ret = 0;
>>>>>
>>>>> -       pager_open();
>>>>>        for (i = 0; i < nbcinfo; i++) {
>>>>> -               sprintf(line, "    cd%d: Device 0x%x\n", i,
>>>>> +               snprintf(line, sizeof(line), "    cd%d: Device 0x%x\n",
>>>>> i,
>>>>>                    bcinfo[i].bc_sp.sp_devicespec);
>>>>> -               if (pager_output(line))
>>>>> +               if ((ret = pager_output(line)) != 0)
>>>>>                        break;
>>>>>        }
>>>>> -       pager_close();
>>>>> +       return (ret);
>>>>> }
>>>>>
>>>>> /*
>>>>>
>>>>> Modified: head/sys/boot/i386/libi386/biosdisk.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/i386/libi386/biosdisk.c       Tue Nov  8 06:13:22 2016
>>>>> (r308433)
>>>>> +++ head/sys/boot/i386/libi386/biosdisk.c       Tue Nov  8 06:50:18 2016
>>>>> (r308434)
>>>>> @@ -135,7 +135,7 @@ static int bd_realstrategy(void *devdata
>>>>> static int bd_open(struct open_file *f, ...);
>>>>> static int bd_close(struct open_file *f);
>>>>> static int bd_ioctl(struct open_file *f, u_long cmd, void *data);
>>>>> -static void bd_print(int verbose);
>>>>> +static int bd_print(int verbose);
>>>>> static void bd_cleanup(void);
>>>>>
>>>>> #ifdef LOADER_GELI_SUPPORT
>>>>> @@ -321,21 +321,21 @@ bd_int13probe(struct bdinfo *bd)
>>>>> /*
>>>>>  * Print information about disks
>>>>>  */
>>>>> -static void
>>>>> +static int
>>>>> bd_print(int verbose)
>>>>> {
>>>>>        static char line[80];
>>>>>        struct disk_devdesc dev;
>>>>> -       int i;
>>>>> +       int i, ret = 0;
>>>>>
>>>>> -       pager_open();
>>>>>        for (i = 0; i < nbdinfo; i++) {
>>>>> -               sprintf(line, "    disk%d:   BIOS drive %c (%ju X
>>>>> %u):\n", i,
>>>>> +               snprintf(line, sizeof(line),
>>>>> +                   "    disk%d:   BIOS drive %c (%ju X %u):\n", i,
>>>>>                    (bdinfo[i].bd_unit < 0x80) ? ('A' +
>>>>> bdinfo[i].bd_unit):
>>>>>                    ('C' + bdinfo[i].bd_unit - 0x80),
>>>>>                    (uintmax_t)bdinfo[i].bd_sectors,
>>>>>                    bdinfo[i].bd_sectorsize);
>>>>> -               if (pager_output(line))
>>>>> +               if ((ret = pager_output(line)) != 0)
>>>>>                        break;
>>>>>                dev.d_dev = &biosdisk;
>>>>>                dev.d_unit = i;
>>>>> @@ -346,12 +346,14 @@ bd_print(int verbose)
>>>>>                    bdinfo[i].bd_sectorsize,
>>>>>                    (bdinfo[i].bd_flags & BD_FLOPPY) ?
>>>>>                    DISK_F_NOCACHE: 0) == 0) {
>>>>> -                       sprintf(line, "    disk%d", i);
>>>>> -                       disk_print(&dev, line, verbose);
>>>>> +                       snprintf(line, sizeof(line), "    disk%d", i);
>>>>> +                       ret = disk_print(&dev, line, verbose);
>>>>>                        disk_close(&dev);
>>>>> +                       if (ret != 0)
>>>>> +                           return (ret);
>>>>>                }
>>>>>        }
>>>>> -       pager_close();
>>>>> +       return (ret);
>>>>> }
>>>>>
>>>>> /*
>>>>>
>>>>> Modified: head/sys/boot/i386/libi386/pxe.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/i386/libi386/pxe.c    Tue Nov  8 06:13:22 2016
>>>>> (r308433)
>>>>> +++ head/sys/boot/i386/libi386/pxe.c    Tue Nov  8 06:50:18 2016
>>>>> (r308434)
>>>>> @@ -75,7 +75,7 @@ static int    pxe_strategy(void *devdata, i
>>>>>                             size_t offset, size_t size, char *buf,
>>>>> size_t *rsize);
>>>>> static int     pxe_open(struct open_file *f, ...);
>>>>> static int     pxe_close(struct open_file *f);
>>>>> -static void    pxe_print(int verbose);
>>>>> +static int     pxe_print(int verbose);
>>>>> static void    pxe_cleanup(void);
>>>>> static void    pxe_setnfshandle(char *rootpath);
>>>>>
>>>>> @@ -381,14 +381,20 @@ pxe_close(struct open_file *f)
>>>>>     return (0);
>>>>> }
>>>>>
>>>>> -static void
>>>>> +static int
>>>>> pxe_print(int verbose)
>>>>> {
>>>>> -
>>>>> +       char line[255];
>>>>>        if (pxe_call == NULL)
>>>>> -               return;
>>>>> +               return (0);
>>>>>
>>>>> -       printf("    pxe0:    %s:%s\n", inet_ntoa(rootip), rootpath);
>>>>> +       if (verbose) {
>>>>> +               snprintf(line, sizeof(line), "    pxe0:    %s:%s\n",
>>>>> +                   inet_ntoa(rootip), rootpath);
>>>>> +       } else {
>>>>> +               snprintf(line, sizeof(line), "    pxe0:\n");
>>>>> +       }
>>>>> +       return (pager_output(line));
>>>>> }
>>>>>
>>>>> static void
>>>>>
>>>>> Modified: head/sys/boot/mips/beri/loader/beri_disk_cfi.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/mips/beri/loader/beri_disk_cfi.c      Tue Nov  8
>>>>> 06:13:22 2016        (r308433)
>>>>> +++ head/sys/boot/mips/beri/loader/beri_disk_cfi.c      Tue Nov  8
>>>>> 06:50:18 2016        (r308434)
>>>>> @@ -47,7 +47,7 @@ static int    beri_cfi_disk_close(struct op
>>>>> static void    beri_cfi_disk_cleanup(void);
>>>>> static int     beri_cfi_disk_strategy(void *, int, daddr_t, size_t,
>>>>> size_t,
>>>>>                    char *, size_t *);
>>>>> -static void    beri_cfi_disk_print(int);
>>>>> +static int     beri_cfi_disk_print(int);
>>>>>
>>>>> struct devsw beri_cfi_disk = {
>>>>>        .dv_name = "cfi",
>>>>> @@ -112,25 +112,29 @@ beri_cfi_disk_close(struct open_file *f)
>>>>>        return (disk_close(dev));
>>>>> }
>>>>>
>>>>> -static void
>>>>> +static int
>>>>> beri_cfi_disk_print(int verbose)
>>>>> {
>>>>>        struct disk_devdesc dev;
>>>>>        char line[80];
>>>>> +       int ret;
>>>>>
>>>>> -       sprintf(line, "    cfi%d   CFI flash device\n", 0);
>>>>> -       pager_output(line);
>>>>> +       snprintf(line, sizeof(line), "    cfi%d   CFI flash device\n",
>>>>> 0);
>>>>> +       ret = pager_output(line);
>>>>> +       if (ret != 0)
>>>>> +               return (ret);
>>>>>        dev.d_dev = &beri_cfi_disk;
>>>>>        dev.d_unit = 0;
>>>>>        dev.d_slice = -1;
>>>>>        dev.d_partition = -1;
>>>>>        if (disk_open(&dev, cfi_get_mediasize(),
>>>>>            cfi_get_sectorsize(), 0) == 0) {
>>>>> -               sprintf(line, "    cfi%d", 0);
>>>>> -               disk_print(&dev, line, verbose);
>>>>> +               snprintf(line, sizeof(line), "    cfi%d", 0);
>>>>> +               ret = disk_print(&dev, line, verbose);
>>>>>                disk_close(&dev);
>>>>>        }
>>>>>
>>>>> +       return (ret);
>>>>> }
>>>>>
>>>>> static void
>>>>>
>>>>> Modified: head/sys/boot/mips/beri/loader/beri_disk_sdcard.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/mips/beri/loader/beri_disk_sdcard.c   Tue Nov  8
>>>>> 06:13:22 2016        (r308433)
>>>>> +++ head/sys/boot/mips/beri/loader/beri_disk_sdcard.c   Tue Nov  8
>>>>> 06:50:18 2016        (r308434)
>>>>> @@ -47,7 +47,7 @@ static int    beri_sdcard_disk_close(struct
>>>>> static void    beri_sdcard_disk_cleanup(void);
>>>>> static int     beri_sdcard_disk_strategy(void *, int, daddr_t, size_t,
>>>>> size_t,
>>>>>                    char *, size_t *);
>>>>> -static void    beri_sdcard_disk_print(int);
>>>>> +static int     beri_sdcard_disk_print(int);
>>>>>
>>>>> struct devsw beri_sdcard_disk = {
>>>>>        .dv_name = "sdcard",
>>>>> @@ -123,19 +123,23 @@ beri_sdcard_disk_print(int verbose)
>>>>> {
>>>>>        struct disk_devdesc dev;
>>>>>        char line[80];
>>>>> +       int ret;
>>>>>
>>>>> -       sprintf(line, "    sdcard%d   Altera SD card drive\n", 0);
>>>>> -       pager_output(line);
>>>>> +       snprintf(line, sizeof(line), "    sdcard%d   Altera SD card
>>>>> drive\n", 0);
>>>>> +       ret = pager_output(line);
>>>>> +       if (ret != 0)
>>>>> +           return (ret);
>>>>>        dev.d_dev = &beri_sdcard_disk;
>>>>>        dev.d_unit = 0;
>>>>>        dev.d_slice = -1;
>>>>>        dev.d_partition = -1;
>>>>>        if (disk_open(&dev, altera_sdcard_get_mediasize(),
>>>>>            altera_sdcard_get_sectorsize(), 0) == 0) {
>>>>> -               sprintf(line, "    sdcard%d", 0);
>>>>> -               disk_print(&dev, line, verbose);
>>>>> +               snprintf(line, sizeof(line), "    sdcard%d", 0);
>>>>> +               ret = disk_print(&dev, line, verbose);
>>>>>                disk_close(&dev);
>>>>>        }
>>>>> +       return (ret);
>>>>> }
>>>>>
>>>>> static void
>>>>>
>>>>> Modified: head/sys/boot/ofw/libofw/ofw_disk.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/ofw/libofw/ofw_disk.c Tue Nov  8 06:13:22 2016
>>>>> (r308433)
>>>>> +++ head/sys/boot/ofw/libofw/ofw_disk.c Tue Nov  8 06:50:18 2016
>>>>> (r308434)
>>>>> @@ -47,7 +47,7 @@ static int    ofwd_strategy(void *devdata,
>>>>> static int     ofwd_open(struct open_file *f, ...);
>>>>> static int     ofwd_close(struct open_file *f);
>>>>> static int     ofwd_ioctl(struct open_file *f, u_long cmd, void *data);
>>>>> -static void    ofwd_print(int verbose);
>>>>> +static int     ofwd_print(int verbose);
>>>>>
>>>>> struct devsw ofwdisk = {
>>>>>        "block",
>>>>> @@ -161,8 +161,8 @@ ofwd_ioctl(struct open_file *f __unused,
>>>>>        return (EINVAL);
>>>>> }
>>>>>
>>>>> -static void
>>>>> +static int
>>>>> ofwd_print(int verbose __unused)
>>>>> {
>>>>> -
>>>>> +       return (0);
>>>>> }
>>>>>
>>>>> Modified: head/sys/boot/pc98/libpc98/bioscd.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/pc98/libpc98/bioscd.c Tue Nov  8 06:13:22 2016
>>>>> (r308433)
>>>>> +++ head/sys/boot/pc98/libpc98/bioscd.c Tue Nov  8 06:50:18 2016
>>>>> (r308434)
>>>>> @@ -99,7 +99,7 @@ static int    bc_realstrategy(void *devdata
>>>>>                    size_t offset, size_t size, char *buf, size_t
>>>>> *rsize);
>>>>> static int     bc_open(struct open_file *f, ...);
>>>>> static int     bc_close(struct open_file *f);
>>>>> -static void    bc_print(int verbose);
>>>>> +static int     bc_print(int verbose);
>>>>>
>>>>> struct devsw bioscd = {
>>>>>        "cd",
>>>>> @@ -173,20 +173,19 @@ bc_add(int biosdev)
>>>>> /*
>>>>>  * Print information about disks
>>>>>  */
>>>>> -static void
>>>>> +static int
>>>>> bc_print(int verbose)
>>>>> {
>>>>>        char line[80];
>>>>> -       int i;
>>>>> +       int i, ret = 0;
>>>>>
>>>>> -       pager_open();
>>>>>        for (i = 0; i < nbcinfo; i++) {
>>>>>                sprintf(line, "    cd%d: Device 0x%x\n", i,
>>>>>                    bcinfo[i].bc_sp.sp_devicespec);
>>>>> -               if (pager_output(line))
>>>>> +               if ((ret = pager_output(line)) != 0)
>>>>>                        break;
>>>>>        }
>>>>> -       pager_close();
>>>>> +       return (ret);
>>>>> }
>>>>>
>>>>> /*
>>>>>
>>>>> Modified: head/sys/boot/pc98/libpc98/biosdisk.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/pc98/libpc98/biosdisk.c       Tue Nov  8 06:13:22 2016
>>>>> (r308433)
>>>>> +++ head/sys/boot/pc98/libpc98/biosdisk.c       Tue Nov  8 06:50:18 2016
>>>>> (r308434)
>>>>> @@ -123,7 +123,7 @@ static int  bd_realstrategy(void *devdata
>>>>>                    size_t offset, size_t size, char *buf, size_t
>>>>> *rsize);
>>>>> static int     bd_open(struct open_file *f, ...);
>>>>> static int     bd_close(struct open_file *f);
>>>>> -static void    bd_print(int verbose);
>>>>> +static int     bd_print(int verbose);
>>>>>
>>>>> struct devsw biosdisk = {
>>>>>     "disk",
>>>>> @@ -249,21 +249,20 @@ bd_int13probe(struct bdinfo *bd)
>>>>> /*
>>>>>  * Print information about disks
>>>>>  */
>>>>> -static void
>>>>> +static int
>>>>> bd_print(int verbose)
>>>>> {
>>>>> -    int                                i, j, done;
>>>>> +    int                                i, j, ret = 0;
>>>>>     char                       line[80];
>>>>>     struct i386_devdesc                dev;
>>>>>     struct open_disk           *od;
>>>>>     struct pc98_partition      *dptr;
>>>>>
>>>>> -    pager_open();
>>>>> -    done = 0;
>>>>> -    for (i = 0; i < nbdinfo && !done; i++) {
>>>>> -       sprintf(line, "    disk%d:   BIOS drive %c:\n", i, 'A' + i);
>>>>> -       if (pager_output(line))
>>>>> -               break;
>>>>> +    for (i = 0; i < nbdinfo; i++) {
>>>>> +       snprintf(line, sizeof(line), "    disk%d:   BIOS drive %c:\n",
>>>>> +           i, 'A' + i);
>>>>> +       if ((ret = pager_output(line)) != 0)
>>>>> +           break;
>>>>>
>>>>>        /* try to open the whole disk */
>>>>>        dev.d_unit = i;
>>>>> @@ -278,17 +277,17 @@ bd_print(int verbose)
>>>>>
>>>>>                /* Check for a "dedicated" disk */
>>>>>                for (j = 0; j < od->od_nslices; j++) {
>>>>> -                   sprintf(line, "      disk%ds%d", i, j + 1);
>>>>> -                   if (bd_printslice(od, &dptr[j], line, verbose)) {
>>>>> -                           done = 1;
>>>>> -                           break;
>>>>> -                   }
>>>>> +                   snprintf(line, sizeof(line), "      disk%ds%d", i, j
>>>>> + 1);
>>>>> +                   if ((ret = bd_printslice(od, &dptr[j], line,
>>>>> verbose)) != 0)
>>>>> +                       break;
>>>>>                }
>>>>>            }
>>>>>            bd_closedisk(od);
>>>>> +           if (ret != 0)
>>>>> +               break;
>>>>>        }
>>>>>     }
>>>>> -    pager_close();
>>>>> +    return (ret);
>>>>> }
>>>>>
>>>>> /* Given a size in 512 byte sectors, convert it to a human-readable
>>>>> number. */
>>>>>
>>>>> Modified: head/sys/boot/powerpc/kboot/hostdisk.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/powerpc/kboot/hostdisk.c      Tue Nov  8 06:13:22 2016
>>>>> (r308433)
>>>>> +++ head/sys/boot/powerpc/kboot/hostdisk.c      Tue Nov  8 06:50:18 2016
>>>>> (r308434)
>>>>> @@ -37,7 +37,7 @@ static int hostdisk_strategy(void *devda
>>>>> static int hostdisk_open(struct open_file *f, ...);
>>>>> static int hostdisk_close(struct open_file *f);
>>>>> static int hostdisk_ioctl(struct open_file *f, u_long cmd, void *data);
>>>>> -static void hostdisk_print(int verbose);
>>>>> +static int hostdisk_print(int verbose);
>>>>>
>>>>> struct devsw hostdisk = {
>>>>>        "/dev",
>>>>> @@ -117,9 +117,9 @@ hostdisk_ioctl(struct open_file *f, u_lo
>>>>>        return (EINVAL);
>>>>> }
>>>>>
>>>>> -static void
>>>>> +static int
>>>>> hostdisk_print(int verbose)
>>>>> {
>>>>> -
>>>>> +       return (0);
>>>>> }
>>>>>
>>>>>
>>>>> Modified: head/sys/boot/powerpc/ps3/ps3cdrom.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/powerpc/ps3/ps3cdrom.c        Tue Nov  8 06:13:22 2016
>>>>> (r308433)
>>>>> +++ head/sys/boot/powerpc/ps3/ps3cdrom.c        Tue Nov  8 06:50:18 2016
>>>>> (r308434)
>>>>> @@ -49,7 +49,7 @@ static int ps3cdrom_strategy(void *devda
>>>>>        size_t offset, size_t size, char *buf, size_t *rsize);
>>>>> static int ps3cdrom_open(struct open_file *f, ...);
>>>>> static int ps3cdrom_close(struct open_file *f);
>>>>> -static void ps3cdrom_print(int verbose);
>>>>> +static int ps3cdrom_print(int verbose);
>>>>>
>>>>> struct devsw ps3cdrom = {
>>>>>        "cd",
>>>>> @@ -149,6 +149,7 @@ static int ps3cdrom_close(struct open_fi
>>>>>        return 0;
>>>>> }
>>>>>
>>>>> -static void ps3cdrom_print(int verbose)
>>>>> +static int ps3cdrom_print(int verbose)
>>>>> {
>>>>> +       return (0);
>>>>> }
>>>>>
>>>>> Modified: head/sys/boot/powerpc/ps3/ps3disk.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/powerpc/ps3/ps3disk.c Tue Nov  8 06:13:22 2016
>>>>> (r308433)
>>>>> +++ head/sys/boot/powerpc/ps3/ps3disk.c Tue Nov  8 06:50:18 2016
>>>>> (r308434)
>>>>> @@ -61,7 +61,7 @@ static int ps3disk_strategy(void *devdat
>>>>>        size_t offset, size_t size, char *buf, size_t *rsize);
>>>>> static int ps3disk_open(struct open_file *f, ...);
>>>>> static int ps3disk_close(struct open_file *f);
>>>>> -static void ps3disk_print(int verbose);
>>>>> +static int ps3disk_print(int verbose);
>>>>>
>>>>> struct devsw ps3disk = {
>>>>>        "disk",
>>>>> @@ -186,8 +186,9 @@ static int ps3disk_close(struct open_fil
>>>>>        return 0;
>>>>> }
>>>>>
>>>>> -static void ps3disk_print(int verbose)
>>>>> +static int ps3disk_print(int verbose)
>>>>> {
>>>>> +       return (0);
>>>>> }
>>>>>
>>>>> static int ps3disk_open_gpt(struct ps3_devdesc *dev, struct open_dev
>>>>> *od)
>>>>>
>>>>> Modified: head/sys/boot/uboot/lib/disk.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/uboot/lib/disk.c      Tue Nov  8 06:13:22 2016
>>>>> (r308433)
>>>>> +++ head/sys/boot/uboot/lib/disk.c      Tue Nov  8 06:50:18 2016
>>>>> (r308434)
>>>>> @@ -78,7 +78,7 @@ static int stor_strategy(void *, int, da
>>>>> static int stor_open(struct open_file *, ...);
>>>>> static int stor_close(struct open_file *);
>>>>> static int stor_ioctl(struct open_file *f, u_long cmd, void *data);
>>>>> -static void stor_print(int);
>>>>> +static int stor_print(int);
>>>>> static void stor_cleanup(void);
>>>>>
>>>>> struct devsw uboot_storage = {
>>>>> @@ -238,30 +238,31 @@ stor_readdev(struct disk_devdesc *dev, d
>>>>>        return (err);
>>>>> }
>>>>>
>>>>> -static void
>>>>> +static int
>>>>> stor_print(int verbose)
>>>>> {
>>>>>        struct disk_devdesc dev;
>>>>>        static char line[80];
>>>>> -       int i;
>>>>> +       int i, ret = 0;
>>>>>
>>>>> -       pager_open();
>>>>>        for (i = 0; i < stor_info_no; i++) {
>>>>>                dev.d_dev = &uboot_storage;
>>>>>                dev.d_unit = i;
>>>>>                dev.d_slice = -1;
>>>>>                dev.d_partition = -1;
>>>>> -               sprintf(line, "\tdisk%d (%s)\n", i,
>>>>> +               snprintf(line, sizeof(line), "\tdisk%d (%s)\n", i,
>>>>>                    ub_stor_type(SI(&dev).type));
>>>>> -               if (pager_output(line))
>>>>> +               if ((ret = pager_output(line)) != 0)
>>>>>                        break;
>>>>>                if (stor_opendev(&dev) == 0) {
>>>>>                        sprintf(line, "\tdisk%d", i);
>>>>> -                       disk_print(&dev, line, verbose);
>>>>> +                       ret = disk_print(&dev, line, verbose);
>>>>>                        disk_close(&dev);
>>>>> +                       if (ret != 0)
>>>>> +                               break;
>>>>>                }
>>>>>        }
>>>>> -       pager_close();
>>>>> +       return (ret);
>>>>> }
>>>>>
>>>>> static int
>>>>>
>>>>> Modified: head/sys/boot/usb/storage/umass_loader.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/usb/storage/umass_loader.c    Tue Nov  8 06:13:22 2016
>>>>> (r308433)
>>>>> +++ head/sys/boot/usb/storage/umass_loader.c    Tue Nov  8 06:50:18 2016
>>>>> (r308434)
>>>>> @@ -50,7 +50,7 @@ static void umass_disk_cleanup(void);
>>>>> static int umass_disk_ioctl(struct open_file *, u_long, void *);
>>>>> static int umass_disk_strategy(void *, int, daddr_t, size_t, size_t,
>>>>> char *,
>>>>>     size_t *);
>>>>> -static void umass_disk_print(int);
>>>>> +static int umass_disk_print(int);
>>>>>
>>>>> struct devsw umass_disk = {
>>>>>        .dv_name = "umass",
>>>>> @@ -170,23 +170,26 @@ umass_disk_close(struct open_file *f)
>>>>>        return (disk_close(dev));
>>>>> }
>>>>>
>>>>> -static void
>>>>> +static int
>>>>> umass_disk_print(int verbose)
>>>>> {
>>>>>        struct disk_devdesc dev;
>>>>>
>>>>>        memset(&dev, 0, sizeof(dev));
>>>>>
>>>>> -       pager_output("    umass0   UMASS device\n");
>>>>> +       ret = pager_output("    umass0   UMASS device\n");
>>>>> +       if (ret != 0)
>>>>> +               return (ret);
>>>>>        dev.d_dev = &umass_disk;
>>>>>        dev.d_unit = 0;
>>>>>        dev.d_slice = -1;
>>>>>        dev.d_partition = -1;
>>>>>
>>>>>        if (umass_disk_open_sub(&dev) == 0) {
>>>>> -               disk_print(&dev, "    umass0", verbose);
>>>>> +               ret = disk_print(&dev, "    umass0", verbose);
>>>>>                disk_close(&dev);
>>>>>        }
>>>>> +       return (ret);
>>>>> }
>>>>>
>>>>> static void
>>>>>
>>>>> Modified: head/sys/boot/userboot/userboot/host.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/userboot/userboot/host.c      Tue Nov  8 06:13:22 2016
>>>>> (r308433)
>>>>> +++ head/sys/boot/userboot/userboot/host.c      Tue Nov  8 06:50:18 2016
>>>>> (r308434)
>>>>> @@ -134,13 +134,13 @@ host_dev_init(void)
>>>>>        return (0);
>>>>> }
>>>>>
>>>>> -static void
>>>>> +static int
>>>>> host_dev_print(int verbose)
>>>>> {
>>>>>        char line[80];
>>>>>
>>>>> -       sprintf(line, "    host%d:   Host filesystem\n", 0);
>>>>> -       pager_output(line);
>>>>> +       snprintf(line, sizeof(line), "    host%d:   Host filesystem\n",
>>>>> 0);
>>>>> +       return (pager_output(line));
>>>>> }
>>>>>
>>>>> /*
>>>>>
>>>>> Modified: head/sys/boot/userboot/userboot/userboot_disk.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/userboot/userboot/userboot_disk.c     Tue Nov  8
>>>>> 06:13:22 2016        (r308433)
>>>>> +++ head/sys/boot/userboot/userboot/userboot_disk.c     Tue Nov  8
>>>>> 06:50:18 2016        (r308434)
>>>>> @@ -60,7 +60,7 @@ static int    userdisk_realstrategy(void *d
>>>>> static int     userdisk_open(struct open_file *f, ...);
>>>>> static int     userdisk_close(struct open_file *f);
>>>>> static int     userdisk_ioctl(struct open_file *f, u_long cmd, void
>>>>> *data);
>>>>> -static void    userdisk_print(int verbose);
>>>>> +static int     userdisk_print(int verbose);
>>>>>
>>>>> struct devsw userboot_disk = {
>>>>>        "disk",
>>>>> @@ -116,27 +116,33 @@ userdisk_cleanup(void)
>>>>> /*
>>>>>  * Print information about disks
>>>>>  */
>>>>> -static void
>>>>> +static int
>>>>> userdisk_print(int verbose)
>>>>> {
>>>>>        struct disk_devdesc dev;
>>>>>        char line[80];
>>>>> -       int i;
>>>>> +       int i, ret = 0;
>>>>>
>>>>>        for (i = 0; i < userdisk_maxunit; i++) {
>>>>> -               sprintf(line, "    disk%d:   Guest drive image\n", i);
>>>>> -               pager_output(line);
>>>>> +               snprintf(line, sizeof(line),
>>>>> +                   "    disk%d:   Guest drive image\n", i);
>>>>> +               ret = pager_output(line);
>>>>> +               if (ret != 0)
>>>>> +                       break;
>>>>>                dev.d_dev = &userboot_disk;
>>>>>                dev.d_unit = i;
>>>>>                dev.d_slice = -1;
>>>>>                dev.d_partition = -1;
>>>>>                if (disk_open(&dev, ud_info[i].mediasize,
>>>>>                    ud_info[i].sectorsize, 0) == 0) {
>>>>> -                       sprintf(line, "    disk%d", i);
>>>>> -                       disk_print(&dev, line, verbose);
>>>>> +                       snprintf(line, sizeof(line), "    disk%d", i);
>>>>> +                       ret = disk_print(&dev, line, verbose);
>>>>>                        disk_close(&dev);
>>>>> +                       if (ret != 0)
>>>>> +                               break;
>>>>>                }
>>>>>        }
>>>>> +       return (ret);
>>>>> }
>>>>>
>>>>> /*
>>>>>
>>>>> Modified: head/sys/boot/zfs/zfs.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/zfs/zfs.c     Tue Nov  8 06:13:22 2016        (r308433)
>>>>> +++ head/sys/boot/zfs/zfs.c     Tue Nov  8 06:50:18 2016        (r308434)
>>>>> @@ -514,20 +514,23 @@ zfs_probe_dev(const char *devname, uint6
>>>>> /*
>>>>>  * Print information about ZFS pools
>>>>>  */
>>>>> -static void
>>>>> +static int
>>>>> zfs_dev_print(int verbose)
>>>>> {
>>>>>        spa_t *spa;
>>>>>        char line[80];
>>>>> +       int ret = 0;
>>>>>
>>>>>        if (verbose) {
>>>>> -               spa_all_status();
>>>>> -               return;
>>>>> +               return (spa_all_status());
>>>>>        }
>>>>>        STAILQ_FOREACH(spa, &zfs_pools, spa_link) {
>>>>> -               sprintf(line, "    zfs:%s\n", spa->spa_name);
>>>>> -               pager_output(line);
>>>>> +               snprintf(line, sizeof(line), "    zfs:%s\n",
>>>>> spa->spa_name);
>>>>> +               ret = pager_output(line);
>>>>> +               if (ret != 0)
>>>>> +                       break;
>>>>>        }
>>>>> +       return (ret);
>>>>> }
>>>>>
>>>>> /*
>>>>>
>>>>> Modified: head/sys/boot/zfs/zfsimpl.c
>>>>>
>>>>> ==============================================================================
>>>>> --- head/sys/boot/zfs/zfsimpl.c Tue Nov  8 06:13:22 2016        (r308433)
>>>>> +++ head/sys/boot/zfs/zfsimpl.c Tue Nov  8 06:50:18 2016        (r308434)
>>>>> @@ -780,7 +780,7 @@ state_name(vdev_state_t state)
>>>>>
>>>>> #else
>>>>>
>>>>> -static void
>>>>> +static int
>>>>> pager_printf(const char *fmt, ...)
>>>>> {
>>>>>        char line[80];
>>>>> @@ -789,14 +789,14 @@ pager_printf(const char *fmt, ...)
>>>>>        va_start(args, fmt);
>>>>>        vsprintf(line, fmt, args);
>>>>>        va_end(args);
>>>>> -       pager_output(line);
>>>>> +       return (pager_output(line));
>>>>> }
>>>>>
>>>>> #endif
>>>>>
>>>>> #define STATUS_FORMAT  "        %s %s\n"
>>>>>
>>>>> -static void
>>>>> +static int
>>>>> print_state(int indent, const char *name, vdev_state_t state)
>>>>> {
>>>>>        int i;
>>>>> @@ -806,40 +806,56 @@ print_state(int indent, const char *name
>>>>>        for (i = 0; i < indent; i++)
>>>>>                strcat(buf, "  ");
>>>>>        strcat(buf, name);
>>>>>
>>>>> *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
>>>>> _______________________________________________
>>>>> svn-src-head at freebsd.org mailing list
>>>>> https://lists.freebsd.org/mailman/listinfo/svn-src-head
>>>>> To unsubscribe, send any mail to "svn-src-head-unsubscribe at freebsd.org"
>>>>
>>>>
>>>>
>>>
>


More information about the svn-src-head mailing list