* glocalfileinfo.c (get_content_type): Try using O_NOATIME when
sniffing for mime types. Based on a patch by A. Walton
svn path=/trunk/; revision=7773
+2009-01-05 Matthias Clasen <mclasen@redhat.com>
+
+ Bug 566064 – Add NOATIME flag to query_info_flags
+
+ * glocalfileinfo.c (get_content_type): Try using O_NOATIME when
+ sniffing for mime types. Based on a patch by A. Walton
+
2009-01-05 Ryan Lortie <desrt@desrt.ca>
* tests/.gitignore: improve
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#define _GNU_SOURCE
#include <fcntl.h>
#include <errno.h>
#ifdef HAVE_GRP_H
sniff_length = _g_unix_content_type_get_sniff_len ();
if (sniff_length > 4096)
sniff_length = 4096;
-
- fd = open (path, O_RDONLY);
+
+#ifdef O_NOATIME
+ fd = open (path, O_RDONLY | O_NOATIME);
+ if (fd < 0 && errno == EPERM)
+#endif
+ fd = open (path, O_RDONLY);
+
if (fd != -1)
{
ssize_t res;