This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Missing errno.h includes
- From: Momchil Velikov <velco at fadata dot bg>
- To: libc-alpha at sources dot redhat dot com
- Date: 25 Nov 2002 01:46:45 +0200
- Subject: Missing errno.h includes
Added ``#include <errno.h>'' to some files, which set ``errno''.
~velco
diff -rudpN libc/tags/initial/sysdeps/posix/readv.c libc/trunk/sysdeps/posix/readv.c
--- libc/tags/initial/sysdeps/posix/readv.c Sun Nov 24 23:48:33 2002
+++ libc/trunk/sysdeps/posix/readv.c Sun Nov 24 23:38:08 2002
@@ -23,6 +23,7 @@
#include <stdbool.h>
#include <sys/param.h>
#include <sys/uio.h>
+#include <errno.h>
/* Read data from file descriptor FD, and put the result in the
buffers described by VECTOR, which is a vector of COUNT `struct iovec's.
@@ -46,7 +47,7 @@ __libc_readv (int fd, const struct iovec
/* Check for ssize_t overflow. */
if (SSIZE_MAX - bytes < vector[i].iov_len)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
bytes += vector[i].iov_len;
diff -rudpN libc/tags/initial/sysdeps/posix/writev.c libc/trunk/sysdeps/posix/writev.c
--- libc/tags/initial/sysdeps/posix/writev.c Sun Nov 24 23:48:34 2002
+++ libc/trunk/sysdeps/posix/writev.c Sun Nov 24 23:38:08 2002
@@ -23,6 +23,7 @@
#include <stdbool.h>
#include <sys/param.h>
#include <sys/uio.h>
+#include <errno.h>
/* Write data pointed by the buffers described by VECTOR, which
is a vector of COUNT `struct iovec's, to file descriptor FD.
@@ -46,7 +47,7 @@ __libc_writev (int fd, const struct iove
/* Check for ssize_t overflow. */
if (SSIZE_MAX - bytes < vector[i].iov_len)
{
- errno = EINVAL;
+ __set_errno (EINVAL);
return -1;
}
bytes += vector[i].iov_len;