POSIXcCompatibility issues in emelfm 0.1.6
- From: Marcus von Appen <mva@xxxxxxxxxxxx>
- To: emelfm2@xxxxxxxxxxxxx
- Date: Fri, 17 Mar 2006 07:26:31 +0100
Hi,
on my way for the release of emelfm2 0.1.6 on FreeBSD I stumbled into
two POSIX compatibility issues, which cause emelfm2 to not to compile on
FreeBSD:
The O_NOATIME flag for the open() interface is GNUish stuff and unlikely
to work on other platforms besides those. See plugins/e2p_dircmp.c, line
382.
__S_IFMT in line 484 and 484 of plugins/e2p_dircmp.c should be S_IFMT,
not, I guess, ass __S_IFMT is not defined in any standard as far as I
can see.
A patch is attached.
Regards
Marcus
--- plugins/e2p_dircmp.c.orig Sun Mar 12 03:27:04 2006
+++ plugins/e2p_dircmp.c Fri Mar 17 07:24:00 2006
@@ -379,7 +379,7 @@
guchar buffer [BUFSIZ];
guchar sum [HASH_LENGTH+1]; //computed hash + trailing \0
- gint descriptor = TEMP_FAILURE_RETRY (open (filename, O_RDONLY |
O_NOATIME));
+ gint descriptor = TEMP_FAILURE_RETRY (open (filename, O_RDONLY));
if (descriptor < 0)
{
e2_task_error_local (_("Cannot open %s for reading"), filename);
@@ -481,8 +481,8 @@
gchar *otherpath = e2_utils_strcat (data->otherpath, (gchar *)
data->name); //localised
if (e2_fs_lstat (otherpath, &othersb))
retval = FALSE; //lstat() failed, assume this means we can't
find a match
- else if ((data->statbuf->st_mode & __S_IFMT) !=
- (othersb.st_mode & __S_IFMT))
+ else if ((data->statbuf->st_mode & S_IFMT) !=
+ (othersb.st_mode & S_IFMT))
retval = FALSE; //unequal type = quick check
else if (data->statbuf->st_size != othersb.st_size)
retval = FALSE; //unequal size = quick check
Other related posts:
- » POSIXcCompatibility issues in emelfm 0.1.6