altos: Always include a check for stdio overflow
authorKeith Packard <keithp@keithp.com>
Sun, 1 Feb 2015 15:42:01 +0000 (16:42 +0100)
committerKeith Packard <keithp@keithp.com>
Sun, 1 Feb 2015 15:42:01 +0000 (16:42 +0100)
For some reason, the check for running out of space to record stdio
devices was disabled when only one device was expected.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/kernel/ao_stdio.c

index 9911813778698fadb89b1e40ec69ee6f91676f89..1d65fcf5c16589270625bbf45a553c9e35f526b1 100644 (file)
@@ -142,10 +142,8 @@ ao_add_stdio(int (*_pollchar)(void),
             void (*putchar)(char),
             void (*flush)(void)) __reentrant
 {
             void (*putchar)(char),
             void (*flush)(void)) __reentrant
 {
-#if AO_NUM_STDIOS > 1
        if (ao_num_stdios == AO_NUM_STDIOS)
                ao_panic(AO_PANIC_STDIO);
        if (ao_num_stdios == AO_NUM_STDIOS)
                ao_panic(AO_PANIC_STDIO);
-#endif
        ao_stdios[ao_num_stdios]._pollchar = _pollchar;
        ao_stdios[ao_num_stdios].putchar = putchar;
        ao_stdios[ao_num_stdios].flush = flush;
        ao_stdios[ao_num_stdios]._pollchar = _pollchar;
        ao_stdios[ao_num_stdios].putchar = putchar;
        ao_stdios[ao_num_stdios].flush = flush;