Skip to content

Commit 3212880

Browse files
authored
Merge pull request #362 from bratkartoffel/bugfix/lfs64-fixes
use regular stat() instead of non-standard __xstat64 abi
2 parents 2cc96a8 + b95a6d4 commit 3212880

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

build.sbt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ val io = (project in file("io"))
134134
exclude[MissingClassProblem]("sbt.internal.io.FreeBSD64FileStat"),
135135
exclude[MissingClassProblem]("sbt.internal.io.FreeBSD64Milli"),
136136
exclude[MissingClassProblem]("sbt.internal.io.FreeBSD64Milli$"),
137+
// Replaced non-standard __xstat64() with conformant stat() calls
138+
exclude[DirectMissingMethodProblem]("sbt.internal.io.Linux32.*"),
139+
exclude[ReversedMissingMethodProblem]("sbt.internal.io.Linux32.*"),
140+
exclude[DirectMissingMethodProblem]("sbt.internal.io.Linux64.*"),
141+
exclude[ReversedMissingMethodProblem]("sbt.internal.io.Linux64.*"),
137142
// protected[this]
138143
exclude[DirectMissingMethodProblem]("sbt.io.CopyOptions.copy*"),
139144
// private class

io/src/main/scala/sbt/internal/io/Milli.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,28 +205,28 @@ private abstract class PosixMilliIntUtim[Interface <: Utimensat[Int]: ClassTag]
205205

206206
private class Linux64FileStat extends StatLong(144, 88, 96)
207207
private trait Linux64 extends Library with Utimensat[Long] {
208-
def __xstat64(version: Int, filePath: String, buf: Linux64FileStat): Int
208+
def stat(filePath: String, buf: Linux64FileStat): Int
209209
}
210210
private object Linux64Milli extends PosixMilliLongUtim[Linux64] {
211211
protected final val AT_FDCWD: Int = -100
212212
protected final val UTIME_OMIT: Long = (1L << 30) - 2
213213
protected def getModifiedTimeNative(filePath: String) = {
214214
val stat = new Linux64FileStat
215-
checkedIO(filePath) { libc.__xstat64(1, filePath, stat) }
215+
checkedIO(filePath) { libc.stat(filePath, stat) }
216216
stat.getModifiedTimeNative
217217
}
218218
}
219219

220220
private class Linux32FileStat extends StatInt(88, 64, 68)
221221
private trait Linux32 extends Library with Utimensat[Int] {
222-
def __xstat(version: Int, filePath: String, buf: Linux32FileStat): Int
222+
def stat(filePath: String, buf: Linux32FileStat): Int
223223
}
224224
private object Linux32Milli extends PosixMilliIntUtim[Linux32] {
225225
protected final val AT_FDCWD: Int = -100
226226
protected final val UTIME_OMIT: Int = ((1 << 30) - 2)
227227
protected def getModifiedTimeNative(filePath: String) = {
228228
val stat = new Linux32FileStat
229-
checkedIO(filePath) { libc.__xstat(3, filePath, stat) }
229+
checkedIO(filePath) { libc.stat(filePath, stat) }
230230
stat.getModifiedTimeNative
231231
}
232232
}

0 commit comments

Comments
 (0)