From: Simon Josefsson Date: Wed, 4 Apr 2012 22:35:19 +0000 (+0200) Subject: [BZ #12340] Fix return code of the Hurd's ttyname_r. X-Git-Tag: upstream/2.30~11294 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d653abb723919fb11f8573cdedf65505c0eca55f;p=external%2Fglibc.git [BZ #12340] Fix return code of the Hurd's ttyname_r. --- diff --git a/ChangeLog b/ChangeLog index 3fe5585..dd4a520 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-04-05 Simon Josefsson + + [BZ #12340] + * sysdeps/mach/hurd/ttyname_r.c (__ttyname_r): Return ERANGE instead of + EINVAL when BUFLEN is too smal. + 2012-04-05 Thomas Schwinge [BZ #13553] diff --git a/sysdeps/mach/hurd/ttyname_r.c b/sysdeps/mach/hurd/ttyname_r.c index 1408ccb..5e5c054 100644 --- a/sysdeps/mach/hurd/ttyname_r.c +++ b/sysdeps/mach/hurd/ttyname_r.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994,1995,1996,1998,2010 Free Software Foundation, Inc. +/* Copyright (C) 1994-2012 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 @@ -42,7 +42,7 @@ __ttyname_r (int fd, char *buf, size_t buflen) len = strlen (nodename) + 1; if (len > buflen) { - errno = EINVAL; + errno = ERANGE; return errno; }