mirror of
https://github.com/apache/nuttx.git
synced 2026-09-27 18:58:27 +08:00
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:
committed by
Alan Carvalho de Assis
parent
0148e1d501
commit
a0f2f6c362
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user