Skip to content

Commit

Permalink
Missed an fstat signature from last work on windows stat
Browse files Browse the repository at this point in the history
  • Loading branch information
enebo committed Oct 22, 2015
1 parent fdf1c93 commit 69ea3e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/jnr/posix/WindowsPOSIX.java
Expand Up @@ -127,7 +127,7 @@ final class WindowsPOSIX extends BaseNativePOSIX {

WindowsPOSIX(LibCProvider libc, POSIXHandler handler) {
super(libc, handler);
this.checkFdStat = allocateStat();
this.checkFdStat = new WindowsFileStat(this);
}

@Override
Expand Down Expand Up @@ -306,6 +306,12 @@ public int lchown(String filename, int user, int group) {

return -1;
}

public FileStat fstat(int fd) {
WindowsFileStat stat = new WindowsFileStat(this);
if (fstat(fd, stat) < 0) handler.error(Errno.valueOf(errno()), "fstat", "" + fd);
return stat;
}

@Override
public int fstat(FileDescriptor fileDescriptor, FileStat stat) {
Expand Down
3 changes: 3 additions & 0 deletions src/test/java/jnr/posix/FileStatTest.java
Expand Up @@ -110,6 +110,9 @@ public void filestatInt() throws Throwable {
} finally {
f.delete();
}
} else {
FileStat stat = posix.fstat(0);
assertTrue(stat != null);
}
}

Expand Down

0 comments on commit 69ea3e0

Please sign in to comment.