From 15be1e8c069b6b7b846d3e16f6a814c4a52e4165 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 24 Mar 2014 14:20:25 +0100 Subject: Fix up warnings in linuxfb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Jørgen Lind --- src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp | 16 +++++++++------- 1 file 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); -- cgit v1.2.3