[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

r5268 - in glibc-package/trunk/debian: . patches patches/hurd-i386



Author: sthibault
Date: 2012-06-03 11:03:39 +0000 (Sun, 03 Jun 2012)
New Revision: 5268

Added:
   glibc-package/trunk/debian/patches/hurd-i386/tg-chflags.diff
Modified:
   glibc-package/trunk/debian/changelog
   glibc-package/trunk/debian/patches/series
Log:
tg-chflags.diff: Fix and add f?chflags prototype.


Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog	2012-06-02 20:30:58 UTC (rev 5267)
+++ glibc-package/trunk/debian/changelog	2012-06-03 11:03:39 UTC (rev 5268)
@@ -26,6 +26,7 @@
   * control/{main,libc}: Remove libpthread-stubs-dev dependency on hurd-i386.
   * patches/hurd-i386/libpthread.diff: Add -lrt in libpthread.a to fix static
     linking.
+  * patches/hurd-i386/tg-chflags.diff: Fix and add f?chflags prototype.
 
   [ Petr Salinger ]
   * kfreebsd/local-sysdeps.diff: update to revision 4286 (from glibc-bsd).

Added: glibc-package/trunk/debian/patches/hurd-i386/tg-chflags.diff
===================================================================
--- glibc-package/trunk/debian/patches/hurd-i386/tg-chflags.diff	                        (rev 0)
+++ glibc-package/trunk/debian/patches/hurd-i386/tg-chflags.diff	2012-06-03 11:03:39 UTC (rev 5268)
@@ -0,0 +1,139 @@
+From: Samuel Thibault <samuel.thibault@ens-lyon.org>
+Subject: [PATCH] Fix f?chflags prototypes, declare them and their flags.
+
+Although they are defined on GNU/Hurd, f?chflags were never declared. It
+seems the BSD prototype actually uses an unsigned long, so we can take
+the opportunity to fix the prototype, while adding an actual
+declaration.
+
+* misc/chflags.c (chflags): Set flags parameter type to unsigned long instead of
+int.
+* misc/fchflags.c (fchflags): Likewise.
+* sysdeps/mach/hurd/chflags.c (chflags): Likewise.
+* sysdeps/mach/hurd/fchflags.c (fchflags): Likewise.
+* sysdeps/mach/hurd/bits/stat.h (UF_SETTABLE, UF_NODUMP, UF_IMMUTABLE,
+UF_APPEND, UF_OPAQUE, UF_NOUNLINK, SF_SETTABLE, SF_ARCHIVED, SF_IMMUTABLE,
+SF_APPEND, SF_NOUNLINK, SF_SNAPSHOT): Declare macros.
+(chflags, fchflags): Declare functions.
+
+
+---
+ misc/chflags.c                |    4 ++--
+ misc/fchflags.c               |    4 ++--
+ sysdeps/mach/hurd/bits/stat.h |   35 +++++++++++++++++++++++++++++++++--
+ sysdeps/mach/hurd/chflags.c   |    2 +-
+ sysdeps/mach/hurd/fchflags.c  |    2 +-
+ 5 files changed, 39 insertions(+), 8 deletions(-)
+
+diff --git a/misc/chflags.c b/misc/chflags.c
+index ea6e742..3b56fe3 100644
+--- a/misc/chflags.c
++++ b/misc/chflags.c
+@@ -21,12 +21,12 @@
+ 
+ /* Change the flags of FILE to FLAGS.  */
+ 
+-int chflags (const char *file, int flags) __THROW;
++int chflags (const char *file, unsigned long int flags) __THROW;
+ 
+ int
+ chflags (file, flags)
+      const char *file;
+-     int flags;
++     unsigned long int flags;
+ {
+   if (file == NULL)
+     {
+diff --git a/misc/fchflags.c b/misc/fchflags.c
+index ebb50db..12c7da3 100644
+--- a/misc/fchflags.c
++++ b/misc/fchflags.c
+@@ -21,12 +21,12 @@
+ 
+ /* Change the flags of the file FD refers to to FLAGS.  */
+ 
+-int fchflags (int fd, int flags) __THROW;
++int fchflags (int fd, unsigned long int flags) __THROW;
+ 
+ int
+ fchflags (fd, flags)
+      int fd;
+-     int flags;
++     unsigned long int flags;
+ {
+   if (fd < 0)
+     {
+diff --git a/sysdeps/mach/hurd/bits/stat.h b/sysdeps/mach/hurd/bits/stat.h
+index 15fcda1..16293d0 100644
+--- a/sysdeps/mach/hurd/bits/stat.h
++++ b/sysdeps/mach/hurd/bits/stat.h
+@@ -193,9 +193,40 @@ struct stat64
+ 			   S_IUSEUNK|S_IUNKNOWN|07777))
+ #endif
+ 
+-/* Default file creation mask (umask).  */
+ #ifdef	__USE_BSD
++
++/* Default file creation mask (umask).  */
+ # define CMASK		0022
++
++
++/* Definitions of flags stored in file flags word.  */
++
++/* Super-user and owner changeable flags.  */
++# define UF_SETTABLE	0x0000ffff	/* mask of owner changeable flags */
++# define UF_NODUMP	0x00000001	/* do not dump file */
++# define UF_IMMUTABLE	0x00000002	/* file may not be changed */
++# define UF_APPEND	0x00000004	/* writes to file may only append */
++# define UF_OPAQUE	0x00000008	/* directory is opaque wrt. union */
++# define UF_NOUNLINK	0x00000010	/* file may not be removed or renamed */
++
++/* Super-user changeable flags.  */
++# define SF_SETTABLE	0xffff0000	/* mask of superuser changeable flags */
++# define SF_ARCHIVED	0x00010000	/* file is archived */
++# define SF_IMMUTABLE	0x00020000	/* file may not be changed */
++# define SF_APPEND	0x00040000	/* writes to file may only append */
++# define SF_NOUNLINK	0x00100000	/* file may not be removed or renamed */
++# define SF_SNAPSHOT	0x00200000	/* snapshot inode */
++
++__BEGIN_DECLS
++
++/* Set file flags for FILE to FLAGS.  */
++extern int chflags (__const char *__file, unsigned long int __flags) __THROW;
++
++/* Set file flags of the file referred to by FD to FLAGS.  */
++extern int fchflags (int __fd, unsigned long int __flags) __THROW;
++
++__END_DECLS
++
+ #endif
+ 
+ #endif	/* bits/stat.h */
+diff --git a/sysdeps/mach/hurd/chflags.c b/sysdeps/mach/hurd/chflags.c
+index 70e5c83..4d7a381 100644
+--- a/sysdeps/mach/hurd/chflags.c
++++ b/sysdeps/mach/hurd/chflags.c
+@@ -24,7 +24,7 @@
+ 
+ /* XXX shouldn't this be __chflags? */
+ int
+-chflags (const char *file, int flags)
++chflags (const char *file, unsigned long int flags)
+ {
+   error_t err;
+   file_t port = __file_name_lookup (file, 0, 0);
+diff --git a/sysdeps/mach/hurd/fchflags.c b/sysdeps/mach/hurd/fchflags.c
+index a3ea084..6af735a 100644
+--- a/sysdeps/mach/hurd/fchflags.c
++++ b/sysdeps/mach/hurd/fchflags.c
+@@ -25,7 +25,7 @@
+ 
+ /* XXX should be __fchflags? */
+ int
+-fchflags (int fd, int flags)
++fchflags (int fd, unsigned long int flags)
+ {
+   error_t err;
+ 
+-- 
+tg: (6a9c587..) t/chflags (depends on: baseline)

Modified: glibc-package/trunk/debian/patches/series
===================================================================
--- glibc-package/trunk/debian/patches/series	2012-06-02 20:30:58 UTC (rev 5267)
+++ glibc-package/trunk/debian/patches/series	2012-06-03 11:03:39 UTC (rev 5268)
@@ -205,6 +205,7 @@
 hurd-i386/submitted-getlogin_r.diff
 hurd-i386/submitted-ptsname.diff
 hurd-i386/submitted-sendto.diff
+hurd-i386/tg-chflags.diff
 
 kfreebsd/submitted-libc_once.diff
 


Reply to: