forked from KolibriOS/kolibrios
NewLib:
- Added basic support for dirent.h; - Added memory.h for compatibility; - Added ftruncate() function; - Fixed date and time structures in ksys_file_info_t. git-svn-id: svn://kolibrios.org@9954 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -27,7 +27,6 @@ _DEFUN (stat, (path, buf),
|
||||
const char *path _AND
|
||||
struct stat *buf)
|
||||
{
|
||||
|
||||
ksys_file_info_t info;
|
||||
struct tm time;
|
||||
|
||||
@@ -41,11 +40,11 @@ _DEFUN (stat, (path, buf),
|
||||
|
||||
buf->st_size = info.size;
|
||||
|
||||
if (info.attr & 0x10)
|
||||
if (info.attr & (KSYS_FILE_ATTR_DIR | KSYS_FILE_ATTR_VOL_LABEL))
|
||||
buf->st_mode = S_IFDIR;
|
||||
else
|
||||
{
|
||||
if (info.attr & 0x07)
|
||||
if (info.attr & (KSYS_FILE_ATTR_SYS | KSYS_FILE_ATTR_HIDDEN | KSYS_FILE_ATTR_RO))
|
||||
buf->st_mode = S_IFREG|S_IRUSR|S_IXUSR;
|
||||
else
|
||||
buf->st_mode = S_IFREG|S_IRUSR|S_IWUSR|S_IXUSR;
|
||||
|
Reference in New Issue
Block a user