diff options
author | Jakub Jelinek <jakub@redhat.com> | 2008-04-08 07:59:52 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2008-04-08 07:59:52 +0000 |
commit | e6e467b8352b6a62b8187fd241671eb55d0f6fc4 (patch) | |
tree | 2e7c2ddae1aa58a70c384e1d5b49d3ad198a2718 /sysdeps/unix | |
parent | 09b731ac2b1b5e79050991f6a9dab964f9a7a60f (diff) | |
download | glibc-e6e467b8352b6a62b8187fd241671eb55d0f6fc4.zip glibc-e6e467b8352b6a62b8187fd241671eb55d0f6fc4.tar.gz glibc-e6e467b8352b6a62b8187fd241671eb55d0f6fc4.tar.bz2 |
Updated to fedora-glibc-20080408T0706
Diffstat (limited to 'sysdeps/unix')
-rw-r--r-- | sysdeps/unix/opendir.c | 28 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/net/ethernet.h | 10 |
2 files changed, 29 insertions, 9 deletions
diff --git a/sysdeps/unix/opendir.c b/sysdeps/unix/opendir.c index 0a11624..92029c6 100644 --- a/sysdeps/unix/opendir.c +++ b/sysdeps/unix/opendir.c @@ -171,6 +171,8 @@ __alloc_dir (int fd, bool close_fd, const struct stat64 *statp) goto lose; } + const size_t default_allocation = (BUFSIZ < sizeof (struct dirent64) + ? sizeof (struct dirent64) : BUFSIZ); size_t allocation; #ifdef _STATBUF_ST_BLKSIZE if (__builtin_expect ((size_t) statp->st_blksize >= sizeof (struct dirent64), @@ -178,20 +180,30 @@ __alloc_dir (int fd, bool close_fd, const struct stat64 *statp) allocation = statp->st_blksize; else #endif - allocation = (BUFSIZ < sizeof (struct dirent64) - ? sizeof (struct dirent64) : BUFSIZ); + allocation = default_allocation; DIR *dirp = (DIR *) malloc (sizeof (DIR) + allocation); if (dirp == NULL) - lose: { - if (close_fd) +#ifdef _STATBUF_ST_BLKSIZE + if (allocation == statp->st_blksize + && allocation != default_allocation) { - int save_errno = errno; - close_not_cancel_no_status (fd); - __set_errno (save_errno); + allocation = default_allocation; + dirp = (DIR *) malloc (sizeof (DIR) + allocation); + } + if (dirp == NULL) +#endif + lose: + { + if (close_fd) + { + int save_errno = errno; + close_not_cancel_no_status (fd); + __set_errno (save_errno); + } + return NULL; } - return NULL; } dirp->fd = fd; diff --git a/sysdeps/unix/sysv/linux/net/ethernet.h b/sysdeps/unix/sysv/linux/net/ethernet.h index 7ca8e83..0242d58 100644 --- a/sysdeps/unix/sysv/linux/net/ethernet.h +++ b/sysdeps/unix/sysv/linux/net/ethernet.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1999, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1999, 2001, 2008 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 @@ -45,9 +45,17 @@ struct ether_header /* Ethernet protocol ID's */ #define ETHERTYPE_PUP 0x0200 /* Xerox PUP */ +#define ETHERTYPE_SPRITE 0x0500 /* Sprite */ #define ETHERTYPE_IP 0x0800 /* IP */ #define ETHERTYPE_ARP 0x0806 /* Address resolution */ #define ETHERTYPE_REVARP 0x8035 /* Reverse ARP */ +#define ETHERTYPE_AT 0x809B /* AppleTalk protocol */ +#define ETHERTYPE_AARP 0x80F3 /* AppleTalk ARP */ +#define ETHERTYPE_VLAN 0x8100 /* IEEE 802.1Q VLAN tagging */ +#define ETHERTYPE_IPX 0x8137 /* IPX */ +#define ETHERTYPE_IPV6 0x86dd /* IP protocol version 6 */ +#define ETHERTYPE_LOOPBACK 0x9000 /* used to test interfaces */ + #define ETHER_ADDR_LEN ETH_ALEN /* size of ethernet addr */ #define ETHER_TYPE_LEN 2 /* bytes in type field */ |