(Courtesy of Brett and combined with my change to use uint8_t to make it work
more nicely on Z80)
extern void tty_outproc(uint8_t minor);
extern void tty_echo(uint8_t minor, unsigned char c);
extern void tty_erase(uint8_t minor);
-extern int tty_putc_maywait(uint8_t minor, unsigned char c, uint8_t flags);
+extern uint8_t tty_putc_maywait(uint8_t minor, unsigned char c, uint8_t flags);
extern void tty_putc_wait(uint8_t minor, unsigned char c);
typedef enum {
}
-int tty_putc_maywait(uint8_t minor, unsigned char c, uint8_t flag)
+uint8_t tty_putc_maywait(uint8_t minor, unsigned char c, uint8_t flag)
{
uint8_t t;
*/
if (!udata.u_ininterrupt) {
- while ((t = tty_writeready(minor)) != TTY_READY_NOW)
+ while ((t = tty_writeready(minor)) != TTY_READY_NOW) {
if (t == TTY_READY_LATER && flag) {
udata.u_error = EAGAIN;
- return -1;
+ return 1;
}
if (t != TTY_READY_SOON || need_reschedule()){
irqflags_t irq = di();
psleep(&ttydata[minor]);
irqrestore(irq);
}
+ }
}
tty_putc(minor, c);
- return 1;
+ return 0;
}
void tty_putc_wait(uint8_t minor, unsigned char ch)