]> git.pld-linux.org Git - packages/dietlibc.git/commitdiff
- add fdopendir
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Mon, 29 Aug 2011 20:46:00 +0000 (20:46 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    dietlibc.spec -> 1.104
    fdopendir.patch -> 1.1

dietlibc.spec
fdopendir.patch [new file with mode: 0644]

index ec6e338a867e8f2b142414bd65a8d7755c0ba622..aed38908b04f37c7f5d88b40239428851903e060 100644 (file)
@@ -39,6 +39,8 @@ Patch17:      %{name}-devmacros.patch
 Patch18:       %{name}-bloat.patch
 Patch19:       %{name}-notify.patch
 Patch20:       %{name}-loop.patch
+# http://svn.exactcode.de/t2/trunk/package/base/dietlibc/fdopendir.patch, needed by util-linux
+Patch21:       fdopendir.patch
 URL:           http://www.fefe.de/dietlibc/
 BuildRequires: rpmbuild(macros) >= 1.566
 BuildRequires: sed >= 4.0
@@ -127,6 +129,7 @@ statyczne.
 %patch18 -p0
 %patch19 -p1
 %patch20 -p1
+%patch21 -p1
 
 %if "%{cc_version}" < "3.4"
 %{__sed} -i -e '/CFLAGS/ s/-Wextra//' Makefile
diff --git a/fdopendir.patch b/fdopendir.patch
new file mode 100644 (file)
index 0000000..28fd4c2
--- /dev/null
@@ -0,0 +1,61 @@
+# --- T2-COPYRIGHT-NOTE-BEGIN ---
+# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
+# 
+# T2 SDE: package/.../dietlibc/fdopendir.patch
+# Copyright (C) 2011 The T2 SDE Project
+# 
+# More information can be found in the files COPYING and README.
+# 
+# This patch file is dual-licensed. It is available under the license the
+# patched project is licensed under, as long as it is an OpenSource license
+# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
+# of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+# --- T2-COPYRIGHT-NOTE-END ---
+
+Of course for udev, too, what else, ...
+
+  - Rene Rebe <rene@exactcode.de>
+
+--- dietlibc/include/dirent.h.vanilla  2011-01-06 12:29:39.000000000 +0100
++++ dietlibc/include/dirent.h  2011-01-06 12:30:04.000000000 +0100
+@@ -33,6 +33,7 @@
+ typedef struct __dirstream DIR;
+ DIR *opendir (const char *__name) __THROW;
++DIR *fdopendir(int fd) __THROW;
+ int closedir (DIR *__dirp) __THROW;
+ struct dirent *readdir (DIR *__dirp) __THROW;
+ struct dirent64 *readdir64 (DIR *__dirp) __THROW;
+--- dietlibc/lib/fdopendir.c.vanilla   2011-01-06 12:30:22.000000000 +0100
++++ dietlibc/lib/fdopendir.c   2011-01-06 12:33:58.000000000 +0100
+@@ -0,0 +1,28 @@
++#include "dietdirent.h"
++#include <sys/mman.h>
++#include <unistd.h>
++#include <dirent.h>
++#include <stdlib.h>
++#include <fcntl.h>
++
++DIR*  fdopendir (int fd) {
++  DIR*  t  = NULL;
++  int flags = fcntl (fd, F_GETFL);
++  if (flags == -1 || (flags & O_DIRECTORY) == 0)
++    goto lose; /* TODO: set errno = ENOTDIR; */
++  
++  if ( fd >= 0 ) {
++    if (fcntl (fd, F_SETFD, FD_CLOEXEC) < 0)
++      goto lose;
++    t = (DIR *) mmap (NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, 
++              MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
++    if (t == MAP_FAILED)
++lose:
++      close (fd);
++    else
++      t->fd = fd;
++  }
++
++
++  return t;
++}
This page took 0.188058 seconds and 4 git commands to generate.