xcb: better error reporting when shmget() fails

Change-Id: I160ebc07f25fd08b86ca5494cb149c5fc7c70086
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
This commit is contained in:
Shawn Rutledge 2015-10-14 12:25:19 +02:00 committed by Shawn Rutledge
parent a8455ac5fa
commit 51dac9890d

View File

@ -146,8 +146,8 @@ QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size, uint depth, QI
int id = shmget(IPC_PRIVATE, segmentSize, IPC_CREAT | 0600); int id = shmget(IPC_PRIVATE, segmentSize, IPC_CREAT | 0600);
if (id == -1) if (id == -1)
qWarning("QXcbShmImage: shmget() failed (%d) for size %d (%dx%d)", qWarning("QXcbShmImage: shmget() failed (%d: %s) for size %d (%dx%d)",
errno, segmentSize, size.width(), size.height()); errno, strerror(errno), segmentSize, size.width(), size.height());
else else
m_shm_info.shmid = id; m_shm_info.shmid = id;
m_shm_info.shmaddr = m_xcb_image->data = (quint8 *)shmat (m_shm_info.shmid, 0, 0); m_shm_info.shmaddr = m_xcb_image->data = (quint8 *)shmat (m_shm_info.shmid, 0, 0);