* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
- if (cur_term == 0
- || GET_TTY(cur_term->Filedes, buf) != 0) {
- memset(buf, 0, sizeof(*buf));
- return (ERR);
+ int result = OK;
+
+ if (cur_term == 0) {
+ result = ERR;
+ } else {
+ for (;;) {
+ if (GET_TTY(cur_term->Filedes, buf) != 0) {
+ if (errno == EINTR)
+ continue;
+ result = ERR;
+ }
+ break;
+ }
TR(TRACE_BITS, ("_nc_get_tty_mode(%d): %s",
cur_term->Filedes, _nc_trace_ttymode(buf)));
TR(TRACE_BITS, ("_nc_get_tty_mode(%d): %s",
cur_term->Filedes, _nc_trace_ttymode(buf)));
- if (cur_term == 0
- || SET_TTY(cur_term->Filedes, buf) != 0) {
- if ((errno == ENOTTY) && (SP != 0))
- SP->_notty = TRUE;
- return (ERR);
+ int result = OK;
+
+ if (cur_term == 0) {
+ result = ERR;
+ } else {
+ for (;;) {
+ if (SET_TTY(cur_term->Filedes, buf) != 0) {
+ if (errno == EINTR)
+ continue;
+ if ((errno == ENOTTY) && (SP != 0))
+ SP->_notty = TRUE;
+ result = ERR;
+ }
+ break;
+ }
}
TR(TRACE_BITS, ("_nc_set_tty_mode(%d): %s",
cur_term->Filedes, _nc_trace_ttymode(buf)));
}
TR(TRACE_BITS, ("_nc_set_tty_mode(%d): %s",
cur_term->Filedes, _nc_trace_ttymode(buf)));