diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-03-24 14:20:25 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-25 12:51:05 +0100 |
commit | 15be1e8c069b6b7b846d3e16f6a814c4a52e4165 (patch) | |
tree | 3ca1eca6fe5efcb92ba7884e6f0b19b03855b279 /src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp | |
parent | f254474d71fb6e11f721e57214940c289a387c8e (diff) |
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>
Diffstat (limited to 'src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp')
-rw-r--r-- | src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp b/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp index aca8d76041..72d5833e73 100644 --- a/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp +++ b/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp @@ -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); |