diff options
-rw-r--r-- | term-utils/agetty.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/term-utils/agetty.c b/term-utils/agetty.c index 862b8c49d..7514015f6 100644 --- a/term-utils/agetty.c +++ b/term-utils/agetty.c @@ -264,11 +264,11 @@ static void login_options_to_argv(char *argv[], int *argc, char *str, char *user static char *fakehost; #ifdef DEBUGGING -#define debug(s) fprintf(dbf,s); fflush(dbf) +#define debug(s) do { fprintf(dbf,s); fflush(dbf); while (0) FILE *dbf; #else -#define debug(s) -#endif /* DEBUGGING */ +#define debug(s) do { ; } while (0) +#endif int main(int argc, char **argv) { @@ -929,7 +929,8 @@ static void open_tty(char *tty, struct termios *tp, struct options *op) */ if (vhangup()) log_err("/dev/%s: vhangup() failed: %m", tty); - ioctl(fd, TIOCNOTTY); + if (ioctl(fd, TIOCNOTTY)) + debug("TIOCNOTTY ioctl failed\n"); } close(fd); @@ -1114,7 +1115,8 @@ static void termio_init(struct options *op, struct termios *tp) ws.ws_col = 80; set++; } - ioctl(STDIN_FILENO, TIOCSWINSZ, &ws); + if (ioctl(STDIN_FILENO, TIOCSWINSZ, &ws)) + debug("TIOCSWINSZ ioctl failed\n"); } /* Optionally enable hardware flow control. */ |