Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
Used wrong error code, fixed that.
Browse files Browse the repository at this point in the history
  • Loading branch information
Armin Schrenk committed Apr 28, 2020
1 parent eb15b75 commit 05f5c91
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ private int createDirectory(Path path, CreationDisposition creationDisposition,
}
} catch (FileSystemException e) {
if (Strings.nullToEmpty(e.getReason()).contains("path too long")) {
LOG.warn("zwCreateFile(): Creation of {} failed, name too long.", path);
return Win32ErrorCode.ERROR_BUFFER_OVERFLOW.getMask();
LOG.warn("zwCreateFile(): Creation of {} failed, file name too long.", path);
return Win32ErrorCode.ERROR_FILENAME_EXCED_RANGE.getMask();
} else {
LOG.debug("zwCreateFile(): IO error occured during the creation of {}.", path);
LOG.debug("zwCreateFile(): ", e);
Expand Down Expand Up @@ -253,8 +253,8 @@ else if ((attr != null && attr.isReadOnly() || ((rawFileAttributes & FileAttribu
return Win32ErrorCode.ERROR_ACCESS_DENIED.getMask();
} catch (FileSystemException e) {
if (Strings.nullToEmpty(e.getReason()).contains("path too long")) {
LOG.warn("zwCreateFile(): Creation of {} failed, name too long.", path);
return Win32ErrorCode.ERROR_BUFFER_OVERFLOW.getMask();
LOG.warn("zwCreateFile(): Creation of {} failed, file name too long.", path);
return Win32ErrorCode.ERROR_FILENAME_EXCED_RANGE.getMask();
} else {
LOG.debug("zwCreateFile(): IO error occured while opening handle to {}.", path);
LOG.debug("zwCreateFile(): ", e);
Expand Down Expand Up @@ -799,8 +799,8 @@ public int moveFile(WString rawPath, WString rawNewFileName, boolean rawReplaceI
return Win32ErrorCode.ERROR_DIR_NOT_EMPTY.getMask();
} catch (FileSystemException e) {
if (Strings.nullToEmpty(e.getReason()).contains("path too long")) {
LOG.warn("({}) Moving resource {} failed, name too long.", path);
return Win32ErrorCode.ERROR_BUFFER_OVERFLOW.getMask();
LOG.warn("({}) Moving resource {} failed, file name too long.", dokanyFileInfo.Context, path);
return Win32ErrorCode.ERROR_FILENAME_EXCED_RANGE.getMask();
} else {
LOG.debug("({}) moveFile(): IO error while moving resource {}.", dokanyFileInfo.Context, path);
LOG.debug("moveFile(): ", e);
Expand Down

0 comments on commit 05f5c91

Please sign in to comment.