mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-22 00:48:53 +02:00
Try using O_NOATIME when sniffing for mime types. Based on a patch by A.
* 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
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
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>
|
2009-01-05 Ryan Lortie <desrt@desrt.ca>
|
||||||
|
|
||||||
* tests/.gitignore: improve
|
* tests/.gitignore: improve
|
||||||
|
@@ -33,6 +33,7 @@
|
|||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
#define _GNU_SOURCE
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#ifdef HAVE_GRP_H
|
#ifdef HAVE_GRP_H
|
||||||
@@ -1234,8 +1235,13 @@ get_content_type (const char *basename,
|
|||||||
sniff_length = _g_unix_content_type_get_sniff_len ();
|
sniff_length = _g_unix_content_type_get_sniff_len ();
|
||||||
if (sniff_length > 4096)
|
if (sniff_length > 4096)
|
||||||
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)
|
if (fd != -1)
|
||||||
{
|
{
|
||||||
ssize_t res;
|
ssize_t res;
|
||||||
|
Reference in New Issue
Block a user