aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/mach/hurd/mmap.c5
-rw-r--r--sysdeps/posix/ttyname_r.c4
-rw-r--r--sysdeps/stub/ttyname_r.c4
3 files changed, 6 insertions, 7 deletions
diff --git a/sysdeps/mach/hurd/mmap.c b/sysdeps/mach/hurd/mmap.c
index 0a804b96bc..dc4b024bb8 100644
--- a/sysdeps/mach/hurd/mmap.c
+++ b/sysdeps/mach/hurd/mmap.c
@@ -98,7 +98,7 @@ __mmap (caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
__mach_port_deallocate (__mach_task_self (), memobj);
}
else if (wobj == MACH_PORT_NULL && /* Not writable by mapping. */
- (flags & (MAP_COPY|MAP_PRIVATE)))
+ !(flags & MAP_SHARED))
/* The file can only be mapped for reading. Since we are
making a private mapping, we will never try to write the
object anyway, so we don't care. */
@@ -106,8 +106,7 @@ __mmap (caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
else
{
__mach_port_deallocate (__mach_task_self (), wobj);
- return ((caddr_t) (long int)
- __hurd_fail (EGRATUITOUS)); /* XXX */
+ return (caddr_t) (long int) __hurd_fail (EACCES);
}
break;
}
diff --git a/sysdeps/posix/ttyname_r.c b/sysdeps/posix/ttyname_r.c
index d404245be5..b3a15d13d1 100644
--- a/sysdeps/posix/ttyname_r.c
+++ b/sysdeps/posix/ttyname_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 95, 96 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 95, 96, 97 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,7 +31,7 @@
#endif
/* Store at most BUFLEN character of the pathname of the terminal FD is
- open on in BUF. Return 0 on success, -1 otherwise. */
+ open on in BUF. Return 0 on success, otherwise an error number. */
int
__ttyname_r (fd, buf, buflen)
int fd;
diff --git a/sysdeps/stub/ttyname_r.c b/sysdeps/stub/ttyname_r.c
index 813fd03809..6599d60b8b 100644
--- a/sysdeps/stub/ttyname_r.c
+++ b/sysdeps/stub/ttyname_r.c
@@ -21,7 +21,7 @@
/* Store at most BUFLEN characters the pathname of the terminal FD is
- open on in BUF. Return 0 on success, -1 otherwise. */
+ open on in BUF. Return 0 on success, otherwise an error number. */
int
ttyname_r (fd, buf, buflen)
int fd;
@@ -29,7 +29,7 @@ ttyname_r (fd, buf, buflen)
size_t buflen;
{
__set_errno (ENOSYS);
- return -1;
+ return ENOSYS;
}