[M108 Aura Migration][NaCl][PPAPI] Fixing error codes in PPB_FileRef 45/289145/2
authorpengxia <pengxia.shen@samsung.com>
Thu, 2 Mar 2023 02:23:29 +0000 (10:23 +0800)
committerBot Blink <blinkbot@samsung.com>
Thu, 9 Mar 2023 02:53:17 +0000 (02:53 +0000)
Trying to delete a non-empty directory or rename any directory
to an existing, non-empty one results in generic error (PP_ERROR_FAILED
that is translated to EPERM by nacl_io). Expected result of such
operation would be something that translates to EEXIST or ENOTEMPTY.

This patch makes PPB_FileRef methods mentioned above
result in PP_ERROR_FILEEXISTS, so that it is translated
to EEXIST by nacl_io.

Ported patch from M94 Aura:
https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/280551/

Change-Id: Ifebf80cc78370a3a170a86dcbd4eb2d10bb41c5a
Signed-off-by: pengxia <pengxia.shen@samsung.com>
ppapi/shared_impl/file_type_conversion.cc

index 8b6cd3b..3e52485 100644 (file)
@@ -16,6 +16,7 @@ int FileErrorToPepperError(base::File::Error error_code) {
     case base::File::FILE_OK:
       return PP_OK;
     case base::File::FILE_ERROR_EXISTS:
+    case base::File::FILE_ERROR_NOT_EMPTY:
       return PP_ERROR_FILEEXISTS;
     case base::File::FILE_ERROR_NOT_FOUND:
       return PP_ERROR_FILENOTFOUND;