[Issue#] N/A
[Bug] Desn't create the file, but returns ok. error code.
[Cause] Missing flag to open, mising goto.
[Solution] Fix the code.
[Verification] N/A
Change-Id: Ibe2064ca055921c5dc060605a90e785531726f60
if (ret != PC_OPERATION_SUCCESS)
goto out;
- fd = open(smack_path, O_RDWR|O_EXCL, 0644);
+ fd = open(smack_path, O_RDWR|O_EXCL|O_CREAT, 0644);
if (fd == -1) {
C_LOGE("file open failed: %s", strerror(errno));
ret = PC_ERR_FILE_OPERATION;
+ goto out;
}
ret = PC_OPERATION_SUCCESS;