diff options
author | Andriy Gapon <avg@FreeBSD.org> | 2012-04-16 10:43:06 +0000 |
---|---|---|
committer | Andriy Gapon <avg@FreeBSD.org> | 2012-04-16 10:43:06 +0000 |
commit | 85d5a233bde4895faa5a3f03c8374839e041e8f8 (patch) | |
tree | b3a0e41ffadfd3f455ad9313f8b26dd5c496a4fd /sys | |
parent | 8b452ff57a098a4298daec7c9be04a933324cd32 (diff) | |
download | src-85d5a233bde4895faa5a3f03c8374839e041e8f8.tar.gz src-85d5a233bde4895faa5a3f03c8374839e041e8f8.zip |
Notes
Diffstat (limited to 'sys')
-rw-r--r-- | sys/boot/i386/zfsboot/zfsboot.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/boot/i386/zfsboot/zfsboot.c b/sys/boot/i386/zfsboot/zfsboot.c index afefc4e89e7e..a6be3ee3a9aa 100644 --- a/sys/boot/i386/zfsboot/zfsboot.c +++ b/sys/boot/i386/zfsboot/zfsboot.c @@ -93,6 +93,7 @@ static const char *const dev_nm[NDEV] = {"ad", "da", "fd"}; static const unsigned char dev_maj[NDEV] = {30, 4, 2}; static char cmd[512]; +static char cmddup[512]; static char kname[1024]; static int comspeed = SIOSPD; static struct bootinfo bootinfo; @@ -541,10 +542,15 @@ main(void) } if (*cmd) { - if (!OPT_CHECK(RBX_QUIET)) - printf("%s: %s", PATH_CONFIG, cmd); + /* + * Note that parse() is destructive to cmd[] and we also want + * to honor RBX_QUIET option that could be present in cmd[]. + */ + memcpy(cmddup, cmd, sizeof(cmd)); if (parse()) autoboot = 0; + if (!OPT_CHECK(RBX_QUIET)) + printf("%s: %s", PATH_CONFIG, cmddup); /* Do not process this command twice */ *cmd = 0; } |