From cb5993c2e67aa267643fc3b352fc7eb1f52836f4 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 21 Jul 1998 12:17:51 +0000 Subject: [PATCH] Return ENAMETOOLONG if buffer is too small. --- sysdeps/unix/sysv/linux/gethostname.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sysdeps/unix/sysv/linux/gethostname.c b/sysdeps/unix/sysv/linux/gethostname.c index 8a01fff073f..a7c707b0991 100644 --- a/sysdeps/unix/sysv/linux/gethostname.c +++ b/sysdeps/unix/sysv/linux/gethostname.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc. +/* Copyright (C) 1992, 1995, 1996, 1998 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 @@ __gethostname (name, len) if (strlen (buf.nodename) + 1 > len) { - __set_errno (EINVAL); + __set_errno (ENAMETOOLONG); return -1; } -- 2.47.2