Fix up warnings in linuxfb

Remove the warning about the graphics mode switch. In some environments
it just pollutes the output since it will always fail.

Change the errno-based warnings to qErrnoWarning.

Change-Id: Ib7a7bfe64eda29996db288e52d369dcfad76c096
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
This commit is contained in:
Laszlo Agocs 2014-03-24 14:20:25 +01:00 committed by The Qt Project
parent f254474d71
commit 15be1e8c06

View File

@ -360,7 +360,7 @@ bool QLinuxFbScreen::initialize()
// Open the device
mFbFd = openFramebufferDevice(fbDevice);
if (mFbFd == -1) {
qWarning("Failed to open framebuffer %s : %s", qPrintable(fbDevice), strerror(errno));
qErrnoWarning(errno, "Failed to open framebuffer %s", qPrintable(fbDevice));
return false;
}
@ -371,12 +371,12 @@ bool QLinuxFbScreen::initialize()
memset(&finfo, 0, sizeof(finfo));
if (ioctl(mFbFd, FBIOGET_FSCREENINFO, &finfo) != 0) {
qWarning("Error reading fixed information: %s", strerror(errno));
qErrnoWarning(errno, "Error reading fixed information");
return false;
}
if (ioctl(mFbFd, FBIOGET_VSCREENINFO, &vinfo)) {
qWarning("Error reading variable information: %s", strerror(errno));
qErrnoWarning(errno, "Error reading variable information");
return false;
}
@ -391,7 +391,7 @@ bool QLinuxFbScreen::initialize()
mMmap.size = finfo.smem_len;
uchar *data = (unsigned char *)mmap(0, mMmap.size, PROT_READ | PROT_WRITE, MAP_SHARED, mFbFd, 0);
if ((long)data == -1) {
qWarning("Failed to mmap framebuffer: %s", strerror(errno));
qErrnoWarning(errno, "Failed to mmap framebuffer");
return false;
}
@ -420,10 +420,12 @@ bool QLinuxFbScreen::initialize()
mTtyFd = openTtyDevice(ttyDevice);
if (mTtyFd == -1)
qWarning() << "Failed to open tty" << strerror(errno);
qErrnoWarning(errno, "Failed to open tty");
if (doSwitchToGraphicsMode && !switchToGraphicsMode(mTtyFd, &mOldTtyMode))
qWarning() << "Failed to set graphics mode" << strerror(errno);
if (doSwitchToGraphicsMode)
switchToGraphicsMode(mTtyFd, &mOldTtyMode);
// Do not warn if the switch fails: the ioctl fails when launching from
// a remote console and there is nothing we can do about it.
blankScreen(mFbFd, false);