diff --git a/src/musredit_qt5/mupp/PmuppGui.cpp b/src/musredit_qt5/mupp/PmuppGui.cpp index aa8707c89..693399ba7 100644 --- a/src/musredit_qt5/mupp/PmuppGui.cpp +++ b/src/musredit_qt5/mupp/PmuppGui.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -471,7 +472,7 @@ void PmuppGui::aboutToQuit() msqid = msgget(key, flags | S_IRUSR | S_IWUSR); if (msqid != -1) { if (msgctl(msqid, IPC_RMID, NULL) == -1) { - std::cerr << "**ERROR** couldn't removed the message queue (msqid=" << msqid << ")." << std::endl << std::endl; + std::cerr << "**ERROR** couldn't removed the message queue (msqid=" << msqid << ", " << std::strerror(errno) << ")." << std::endl << std::endl; } } } @@ -2376,7 +2377,7 @@ void PmuppGui::plot() key = ftok(QCoreApplication::applicationFilePath().toLatin1().data(), fMuppInstance); if (key == -1) { - QMessageBox::critical(this, "ERROR", "Couldn't obtain necessary key to install the IPC message queue."); + QMessageBox::critical(this, "ERROR", QString("Couldn't obtain necessary key to install the IPC message queue (%1).").arg(std::strerror(errno))); return; } @@ -2386,7 +2387,7 @@ void PmuppGui::plot() // open the message queue msqid = msgget(key, flags | S_IRUSR | S_IWUSR); if (msqid == -1) { - QMessageBox::critical(this, "ERROR", "Couldn't open the IPC message queue."); + QMessageBox::critical(this, "ERROR", QString("Couldn't open the IPC message queue (%1).").arg(std::strerror(errno))); return; } @@ -2395,7 +2396,7 @@ void PmuppGui::plot() msg.mtype = 1; strncpy(msg.mtext, pathName.toLatin1().data(), PMUPP_MAX_MTEXT); if (msgsnd(msqid, &msg, strlen(msg.mtext)+1, flags) == -1) { - QMessageBox::critical(this, "ERROR", "Couldn't send the IPC message."); + QMessageBox::critical(this, "ERROR", QString("Couldn't send the IPC message (%1).").arg(std::strerror(errno))); return; } diff --git a/src/musredit_qt6/mupp/PmuppGui.cpp b/src/musredit_qt6/mupp/PmuppGui.cpp index c9b74528a..2350395a6 100644 --- a/src/musredit_qt6/mupp/PmuppGui.cpp +++ b/src/musredit_qt6/mupp/PmuppGui.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -470,7 +471,7 @@ void PmuppGui::aboutToQuit() msqid = msgget(key, flags | S_IRUSR | S_IWUSR); if (msqid != -1) { if (msgctl(msqid, IPC_RMID, NULL) == -1) { - std::cerr << "**ERROR** couldn't removed the message queue (msqid=" << msqid << ")." << std::endl << std::endl; + std::cerr << "**ERROR** couldn't removed the message queue (msqid=" << msqid << ", " << std::strerror(errno) << ")." << std::endl << std::endl; } } } @@ -2185,7 +2186,7 @@ void PmuppGui::plot() key = ftok(QCoreApplication::applicationFilePath().toLatin1().data(), fMuppInstance); if (key == -1) { - QMessageBox::critical(this, "ERROR", "Couldn't obtain necessary key to install the IPC message queue."); + QMessageBox::critical(this, "ERROR", QString("Couldn't obtain necessary key to install the IPC message queue (%1).").arg(std::strerror(errno))); return; } @@ -2195,7 +2196,7 @@ void PmuppGui::plot() // open the message queue msqid = msgget(key, flags | S_IRUSR | S_IWUSR); if (msqid == -1) { - QMessageBox::critical(this, "ERROR", "Couldn't open the IPC message queue."); + QMessageBox::critical(this, "ERROR", QString("Couldn't open the IPC message queue (%1).").arg(std::strerror(errno))); return; } @@ -2204,7 +2205,7 @@ void PmuppGui::plot() msg.mtype = 1; strncpy(msg.mtext, pathName.toLatin1().data(), PMUPP_MAX_MTEXT); if (msgsnd(msqid, &msg, strlen(msg.mtext)+1, flags) == -1) { - QMessageBox::critical(this, "ERROR", "Couldn't send the IPC message."); + QMessageBox::critical(this, "ERROR", QString("Couldn't send the IPC message (%1).").arg(std::strerror(errno))); return; }