Skip to content

Commit 6956e4b

Browse files
fix EPERM throwing code
1 parent 2828919 commit 6956e4b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/node_file.cc

+1-3
Original file line numberDiff line numberDiff line change
@@ -3381,11 +3381,9 @@ static void CpSyncOverrideFile(const FunctionCallbackInfo<Value>& args) {
33813381

33823382
std::filesystem::remove(*dest, error);
33833383
if (error) {
3384-
auto dest_path = BufferValueToPath(dest);
3385-
auto dest_path_str = PathToString(dest_path);
33863384
std::string message = "operation not permitted, unlink";
33873385
return env->ThrowErrnoException(
3388-
EPERM, "unlink", message.c_str(), dest_path.c_str());
3386+
EPERM, "unlink", message.c_str(), dest.out());
33893387
}
33903388

33913389
if (mode == 0) {

0 commit comments

Comments
 (0)