提交 629eed88 编写于 作者: J Jeff Sharkey

fallocate() returning ENOSYS is okay.

Fall back just like ENOTSUP.

Bug: 17285472
Change-Id: Ice4954726c14a0e84c39c5469d573644588934ae
上级 dccf3823
......@@ -467,8 +467,8 @@ public class DownloadThread implements Runnable {
// We found enough space, so claim it for ourselves
Os.posix_fallocate(outFd, 0, mInfoDelta.mTotalBytes);
} catch (ErrnoException e) {
if (e.errno == OsConstants.ENOTSUP) {
Log.w(TAG, "fallocate() said ENOTSUP; falling back to ftruncate()");
if (e.errno == OsConstants.ENOSYS || e.errno == OsConstants.ENOTSUP) {
Log.w(TAG, "fallocate() not supported; falling back to ftruncate()");
Os.ftruncate(outFd, mInfoDelta.mTotalBytes);
} else {
throw e;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册