summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp
diff options
context:
space:
mode:
authorIikka Eklund <iikka.eklund@digia.com>2014-04-02 07:36:48 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-02 07:36:48 +0200
commitd6f58e5e17d58c640fc7779652008fda0d66f41d (patch)
treed50d27e260c9eaf4bc2bcb4480b8a069a3aed857 /src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp
parent83de197a57ff6c3e5bbad26bd871981285384fcb (diff)
parent0ab63b035a649dc1982c867cd37d466d249004b9 (diff)
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp')
-rw-r--r--src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp16
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);