mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Update.
* sysdeps/unix/sysv/linux/if_index.c (if_nameindex): Set errno to ENOBUFS if we are out of memory.
This commit is contained in:
@ -1,5 +1,8 @@
|
|||||||
2000-04-30 Ulrich Drepper <drepper@redhat.com>
|
2000-04-30 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/if_index.c (if_nameindex): Set errno to
|
||||||
|
ENOBUFS if we are out of memory.
|
||||||
|
|
||||||
* sysdeps/generic/bits/fcntl.h (F_SETOWN, F_GETOWN): Make
|
* sysdeps/generic/bits/fcntl.h (F_SETOWN, F_GETOWN): Make
|
||||||
available if __USE_XOPEN2K.
|
available if __USE_XOPEN2K.
|
||||||
* sysdeps/mach/hurd/bits/fcntl.h: Likewise.
|
* sysdeps/mach/hurd/bits/fcntl.h: Likewise.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
|
/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -133,6 +133,7 @@ if_nameindex (void)
|
|||||||
if (idx == NULL)
|
if (idx == NULL)
|
||||||
{
|
{
|
||||||
__close (fd);
|
__close (fd);
|
||||||
|
__set_errno (ENOBUFS);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,7 +152,10 @@ if_nameindex (void)
|
|||||||
free (idx);
|
free (idx);
|
||||||
__close (fd);
|
__close (fd);
|
||||||
if (saved_errno == EINVAL)
|
if (saved_errno == EINVAL)
|
||||||
__set_errno (ENOSYS);
|
saved_errno = ENOSYS;
|
||||||
|
else if (saved_errno == ENOMEM)
|
||||||
|
saved_errno = ENOBUFS;
|
||||||
|
__set_errno (saved_errno);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
idx[i].if_index = ifr->ifr_ifindex;
|
idx[i].if_index = ifr->ifr_ifindex;
|
||||||
|
Reference in New Issue
Block a user