diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-04-06 20:28:45 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-04-06 20:28:45 +0000 |
commit | 6278781655261a5011376b2fa2600996e32ca889 (patch) | |
tree | 11783e71b36c8c546c4dc02dff355b0f2478978b /libc/termios | |
parent | a704ccaa5232184844cd67315951b39f85a6ba04 (diff) | |
download | uClibc-alpine-6278781655261a5011376b2fa2600996e32ca889.tar.bz2 uClibc-alpine-6278781655261a5011376b2fa2600996e32ca889.tar.xz |
Fix include/errno.h to not use kernel header, and instead use bits/errno.h.
This required we use _LIBC instead of __LIBC__ to be consistent with glibc.
This had some sideffects in sys/syscalls.h. While fixing things, I made
everything use __set_errno() for (eventual) thread support.
-Erik
Diffstat (limited to 'libc/termios')
-rw-r--r-- | libc/termios/tcgetsid.c | 4 | ||||
-rw-r--r-- | libc/termios/tcsetattr.c | 6 | ||||
-rw-r--r-- | libc/termios/termios.c | 6 | ||||
-rw-r--r-- | libc/termios/ttyname.c | 6 |
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; } |