summaryrefslogtreecommitdiff
path: root/libc/termios
diff options
context:
space:
mode:
Diffstat (limited to 'libc/termios')
-rw-r--r--libc/termios/tcgetsid.c4
-rw-r--r--libc/termios/tcsetattr.c6
-rw-r--r--libc/termios/termios.c6
-rw-r--r--libc/termios/ttyname.c6
4 files changed, 11 insertions, 11 deletions
diff --git a/libc/termios/tcgetsid.c b/libc/termios/tcgetsid.c
index 35e1c95eb..5e4addece 100644
--- a/libc/termios/tcgetsid.c
+++ b/libc/termios/tcgetsid.c
@@ -42,7 +42,7 @@ pid_t tcgetsid (int fd)
if (errno == EINVAL)
{
tiocgsid_does_not_work = 1;
- errno=serrno;
+ __set_errno(serrno);
}
else
return (pid_t) -1;
@@ -58,7 +58,7 @@ pid_t tcgetsid (int fd)
sid = getsid (pgrp);
if (sid == -1 && errno == ESRCH)
- errno=ENOTTY;
+ __set_errno(ENOTTY);
return sid;
}
diff --git a/libc/termios/tcsetattr.c b/libc/termios/tcsetattr.c
index 30ea46f4c..bb8c84d5c 100644
--- a/libc/termios/tcsetattr.c
+++ b/libc/termios/tcsetattr.c
@@ -69,7 +69,7 @@ tcsetattr (fd, optional_actions, termios_p)
cmd = TCSETSF;
break;
default:
- errno=EINVAL;
+ __set_errno(EINVAL);
return -1;
}
@@ -99,7 +99,7 @@ tcsetattr (fd, optional_actions, termios_p)
{
/* We cannot verify if the setting is ok. We don't return
an error (?). */
- errno=save;
+ __set_errno(save);
retval = 0;
}
else if ((termios_p->c_cflag & (PARENB | CREAD))
@@ -111,7 +111,7 @@ tcsetattr (fd, optional_actions, termios_p)
/* It looks like the Linux kernel silently changed the
PARENB/CREAD/CSIZE bits in c_cflag. Report it as an
error. */
- errno=EINVAL;
+ __set_errno(EINVAL);
retval = -1;
}
}
diff --git a/libc/termios/termios.c b/libc/termios/termios.c
index a180e1011..d6cd124d1 100644
--- a/libc/termios/termios.c
+++ b/libc/termios/termios.c
@@ -88,7 +88,7 @@ int tcsendbreak( int fd, int duration)
* changed to use trickery (e.g. lower speed and send a '\0') to send
* the break, but for now just return an error.
*/
- errno = EINVAL;
+ __set_errno(EINVAL);
return -1;
}
#endif
@@ -151,7 +151,7 @@ int cfsetospeed (struct termios *termios_p, speed_t speed)
if ((speed & ~CBAUD) != 0
&& (speed < B57600 || speed > B460800))
{
- errno=EINVAL;
+ __set_errno(EINVAL);
return -1;
}
@@ -172,7 +172,7 @@ int cfsetispeed ( struct termios *termios_p, speed_t speed)
if ((speed & ~CBAUD) != 0
&& (speed < B57600 || speed > B460800))
{
- errno=EINVAL;
+ __set_errno(EINVAL);
return -1;
}
diff --git a/libc/termios/ttyname.c b/libc/termios/ttyname.c
index ee78137c0..2aa009104 100644
--- a/libc/termios/ttyname.c
+++ b/libc/termios/ttyname.c
@@ -17,7 +17,7 @@ int fd;
if (fstat(fd, &st) < 0)
return 0;
if (!isatty(fd)) {
- errno = ENOTTY;
+ __set_errno(ENOTTY);
return 0;
}
@@ -32,11 +32,11 @@ int fd;
if (stat(name, &dst) == 0
&& st.st_dev == dst.st_dev && st.st_ino == dst.st_ino) {
closedir(fp);
- errno = noerr;
+ __set_errno(noerr);
return name;
}
}
closedir(fp);
- errno = noerr;
+ __set_errno(noerr);
return 0;
}