return mode;
}
-static int set_sparse_flag(const SMB_STRUCT_STAT * const sbuf)
-{
-#if defined (HAVE_STAT_ST_BLOCKS) && defined(STAT_ST_BLOCKSIZE)
- if (sbuf->st_ex_size > sbuf->st_ex_blocks * (SMB_OFF_T)STAT_ST_BLOCKSIZE) {
- return FILE_ATTRIBUTE_SPARSE;
- }
-#endif
- return 0;
-}
-
static int set_link_read_only_flag(const SMB_STRUCT_STAT *const sbuf)
{
#ifdef S_ISLNK
if (S_ISDIR(smb_fname->st.st_ex_mode))
result = aDIR | (result & aRONLY);
- result |= set_sparse_flag(&smb_fname->st);
result |= set_link_read_only_flag(&smb_fname->st);
DEBUG(8,("dos_mode_from_sbuf returning "));
if (S_ISDIR(smb_fname->st.st_ex_mode))
*dosmode |= aDIR;
- *dosmode |= set_sparse_flag(&smb_fname->st);
*dosmode |= set_link_read_only_flag(&smb_fname->st);
return true;
#endif
if (!used_stat_dos_flags) {
/* Get the DOS attributes from an EA by preference. */
- if (get_ea_dos_attribute(conn, smb_fname, &result)) {
- result |= set_sparse_flag(&smb_fname->st);
- } else {
+ if (!get_ea_dos_attribute(conn, smb_fname, &result)) {
result |= dos_mode_from_sbuf(conn, smb_fname);
}
}