aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-04-08 07:59:52 +0000
committerJakub Jelinek <jakub@redhat.com>2008-04-08 07:59:52 +0000
commite6e467b8352b6a62b8187fd241671eb55d0f6fc4 (patch)
tree2e7c2ddae1aa58a70c384e1d5b49d3ad198a2718 /sysdeps
parent09b731ac2b1b5e79050991f6a9dab964f9a7a60f (diff)
downloadglibc-e6e467b8352b6a62b8187fd241671eb55d0f6fc4.tar
glibc-e6e467b8352b6a62b8187fd241671eb55d0f6fc4.tar.gz
glibc-e6e467b8352b6a62b8187fd241671eb55d0f6fc4.tar.bz2
glibc-e6e467b8352b6a62b8187fd241671eb55d0f6fc4.zip
Updated to fedora-glibc-20080408T0706
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/posix/tempname.c2
-rw-r--r--sysdeps/unix/opendir.c28
-rw-r--r--sysdeps/unix/sysv/linux/net/ethernet.h10
3 files changed, 30 insertions, 10 deletions
diff --git a/sysdeps/posix/tempname.c b/sysdeps/posix/tempname.c
index eab658da31..be979d8c8a 100644
--- a/sysdeps/posix/tempname.c
+++ b/sysdeps/posix/tempname.c
@@ -297,7 +297,7 @@ __gen_tempname (char *tmpl, int flags, int kind)
{
case __GT_FILE:
fd = __open (tmpl,
- (flags & ~ACCESSPERMS)
+ (flags & ~O_ACCMODE)
| O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
break;
diff --git a/sysdeps/unix/opendir.c b/sysdeps/unix/opendir.c
index 0a116247d2..92029c6547 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 7ca8e8348e..0242d5899e 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 */