ftok:check mkdir return value.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
This commit is contained in:
parent
f45eaa608d
commit
523b72d095
|
@ -66,8 +66,8 @@ key_t ftok(FAR const char *pathname, int proj_id)
|
|||
{
|
||||
/* Directory not exist, let's create one for caller */
|
||||
|
||||
mkdir(fullpath, S_IRWXU);
|
||||
if (stat(fullpath, &st) < 0)
|
||||
if (mkdir(fullpath, S_IRWXU) < 0 ||
|
||||
stat(fullpath, &st) < 0)
|
||||
{
|
||||
return (key_t)-1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue