mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-14 00:06:24 +01:00
glocalfileinfo: Only return file mode, not type, as UNIX_MODE attribute
As with the previous commit, `st_mode` contains both the file type (regular file, directory, symlink, special, etc.) and the file mode. For `G_FILE_ATTRIBUTE_ID_UNIX_MODE`, we only want the file mode — so mask `st_mode` with `~S_IFMT`. Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
parent
5dd5269126
commit
bfdc5fc4fc
@ -984,7 +984,7 @@ set_info_from_stat (GFileInfo *info,
|
|||||||
/* Mostly pointless on Windows.
|
/* Mostly pointless on Windows.
|
||||||
* Still, it allows for S_ISREG/S_ISDIR and IWRITE (read-only) checks.
|
* Still, it allows for S_ISREG/S_ISDIR and IWRITE (read-only) checks.
|
||||||
*/
|
*/
|
||||||
_g_file_info_set_attribute_uint32_by_id (info, G_FILE_ATTRIBUTE_ID_UNIX_MODE, statbuf->st_mode);
|
_g_file_info_set_attribute_uint32_by_id (info, G_FILE_ATTRIBUTE_ID_UNIX_MODE, statbuf->st_mode & ~S_IFMT);
|
||||||
#if defined (HAVE_STRUCT_STAT_ST_BLKSIZE)
|
#if defined (HAVE_STRUCT_STAT_ST_BLKSIZE)
|
||||||
_g_file_info_set_attribute_uint32_by_id (info, G_FILE_ATTRIBUTE_ID_UNIX_BLOCK_SIZE, statbuf->st_blksize);
|
_g_file_info_set_attribute_uint32_by_id (info, G_FILE_ATTRIBUTE_ID_UNIX_BLOCK_SIZE, statbuf->st_blksize);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user