fs: Move umask to task_info_s

and implement the related semantic correctly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I0587341e2c505e41b5e24e55dba039ed200d65f2
This commit is contained in:
Xiang Xiao
2021-07-14 10:35:15 -03:00
committed by Alan Carvalho de Assis
parent 0148e1d501
commit a0f2f6c362
7 changed files with 36 additions and 16 deletions
+19 -8
View File
@@ -23,12 +23,7 @@
****************************************************************************/
#include <sys/stat.h>
/****************************************************************************
* Private Data
****************************************************************************/
static mode_t g_mask;
#include <nuttx/tls.h>
/****************************************************************************
* Public Functions
@@ -50,8 +45,24 @@ static mode_t g_mask;
mode_t umask(mode_t mask)
{
mode_t prev = g_mask;
FAR struct task_info_s *info;
mode_t prev;
info = task_get_info();
prev = info->ta_umask;
info->ta_umask = mask;
g_mask = mask & 0777;
return prev;
}
/****************************************************************************
* Name: getumask
****************************************************************************/
mode_t getumask(void)
{
FAR struct task_info_s *info;
info = task_get_info();
return info->ta_umask;
}