Skip to content

Commit

Permalink
BZ #11537: Hurd: Fix ttyname_r error return value.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno Haible authored and Roland McGrath committed Apr 26, 2010
1 parent 6748140 commit 6cffee3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2010-04-25 Bruno Haible <bruno@clisp.org>

[BZ #11537]
* sysdeps/mach/hurd/ttyname_r.c (__ttyname_r): Upon failure, return
errno, not -1.

2010-04-24 Emilio Pozuelo Monfort <pochu27@gmail.com>

* hurd/lookup-at.c (__file_name_lookup_at): Fix error return value.
Expand Down
6 changes: 3 additions & 3 deletions sysdeps/mach/hurd/ttyname_r.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 1994, 95, 96, 98 Free Software Foundation, Inc.
/* Copyright (C) 1994,1995,1996,1998,2010 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
Expand Down Expand Up @@ -34,13 +34,13 @@ __ttyname_r (int fd, char *buf, size_t buflen)

nodename[0] = '\0';
if (err = HURD_DPORT_USE (fd, __term_get_nodename (port, nodename)))
return __hurd_dfail (fd, err), -1;
return __hurd_dfail (fd, err), errno;

len = strlen (nodename) + 1;
if (len > buflen)
{
errno = EINVAL;
return -1;
return errno;
}

memcpy (buf, nodename, len);
Expand Down

0 comments on commit 6cffee3

Please sign in to comment.