Skip to content

Commit

Permalink
prevent log spam
Browse files Browse the repository at this point in the history
  • Loading branch information
infeo committed Apr 24, 2023
1 parent 0ae8384 commit e57d0fb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ public int chmod(String path, int mode, FileInfo fi) {
LOG.warn("chmod {} failed, file not found.", path);
return -errno.enoent();
} catch (UnsupportedOperationException e) {
LOG.warn("Setting posix permissions not supported by underlying file system.");
if (!WindowsUtil.IS_RUNNING_OS) { //prevent spamming warnings
LOG.warn("Setting posix permissions not supported by underlying file system.");
}
return -errno.enosys();
} catch (IOException | RuntimeException e) {
LOG.error("chmod {} failed.", path, e);
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/org/cryptomator/frontend/fuse/WindowsUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.cryptomator.frontend.fuse;

public class WindowsUtil {

public static final boolean IS_RUNNING_OS = System.getProperty("os.name").toLowerCase().contains("windows");

private WindowsUtil() {}


}

0 comments on commit e57d0fb

Please sign in to comment.