stat fixes for version 0.3.6
- From: Marcus von Appen <mva@xxxxxxxxxxxx>
- To: emelfm2 <emelfm2@xxxxxxxxxxxxx>
- Date: Sun, 9 Dec 2007 12:28:00 +0100
Hi,
plugins/e2p_find.c uses some non-compliant macros for the different
stat() modes. __S_* is not defined by POSIX.1 and if I see it right, the
linux system headers also redefine them to POSIX-compliant S_* macros.
For non-Linux systems such as the BSDs, the current find plugin code
won't compile, so please apply the attached patch.
Regards
Marcus
--- plugins/e2p_find.orig.c 2007-12-09 12:14:12.000000000 +0100
+++ plugins/e2p_find.c 2007-12-09 12:14:47.000000000 +0100
@@ -820,24 +820,24 @@
//flag-order is
//REGULAR_P, DIRECTORY_P, RAW_DEVICE_P, BLOCK_DEVICE_P, SYMLINK_P, SOCKET_P,
FIFO_P
guint masks [7] =
- { __S_IFREG, __S_IFDIR, __S_IFCHR, __S_IFBLK,
-#ifdef __S_IFLNK
- __S_IFLNK,
+ { S_IFREG, S_IFDIR, S_IFCHR, S_IFBLK,
+#ifdef S_IFLNK
+ S_IFLNK,
#else
0,
#endif
-#ifdef __S_IFSOCK
- __S_IFSOCK,
+#ifdef S_IFSOCK
+ S_IFSOCK,
#else
0,
#endif
-#ifdef __S_IFIFO
- __S_IFIFO,
+#ifdef S_IFIFO
+ S_IFIFO,
#else
0,
#endif
};
- mode_t masked = statptr->st_mode & __S_IFMT;
+ mode_t masked = statptr->st_mode & S_IFMT;
for (i = 0; i < 7 ; i++)
{
c = 1 << i;
Other related posts:
- » stat fixes for version 0.3.6