packages: dietlibc/dietlibc.spec, dietlibc/fdopendir.patch (NEW) - add fdop...

arekm arekm at pld-linux.org
Mon Aug 29 22:46:05 CEST 2011


Author: arekm                        Date: Mon Aug 29 20:46:05 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- add fdopendir

---- Files affected:
packages/dietlibc:
   dietlibc.spec (1.103 -> 1.104) , fdopendir.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/dietlibc/dietlibc.spec
diff -u packages/dietlibc/dietlibc.spec:1.103 packages/dietlibc/dietlibc.spec:1.104
--- packages/dietlibc/dietlibc.spec:1.103	Mon May 30 17:52:10 2011
+++ packages/dietlibc/dietlibc.spec	Mon Aug 29 22:45:59 2011
@@ -40,6 +40,8 @@
 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
@@ -128,6 +130,7 @@
 %patch18 -p0
 %patch19 -p1
 %patch20 -p1
+%patch21 -p1
 
 %if "%{cc_version}" < "3.4"
 %{__sed} -i -e '/CFLAGS/ s/-Wextra//' Makefile
@@ -207,6 +210,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.104  2011/08/29 20:45:59  arekm
+- add fdopendir
+
 Revision 1.103  2011/05/30 15:52:10  arekm
 - rel 13; more loop stuff
 

================================================================
Index: packages/dietlibc/fdopendir.patch
diff -u /dev/null packages/dietlibc/fdopendir.patch:1.1
--- /dev/null	Mon Aug 29 22:46:05 2011
+++ packages/dietlibc/fdopendir.patch	Mon Aug 29 22:46:00 2011
@@ -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 at 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;
++}
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/dietlibc/dietlibc.spec?r1=1.103&r2=1.104&f=u



More information about the pld-cvs-commit mailing list