summaryrefslogtreecommitdiff
path: root/noncore/tools/remote/buttondialog.cpp
Side-by-side diff
Diffstat (limited to 'noncore/tools/remote/buttondialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/tools/remote/buttondialog.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/noncore/tools/remote/buttondialog.cpp b/noncore/tools/remote/buttondialog.cpp
index e7ff4b4..7479e85 100644
--- a/noncore/tools/remote/buttondialog.cpp
+++ b/noncore/tools/remote/buttondialog.cpp
@@ -98,6 +98,18 @@ QStringList ButtonDialog::getRemotes()
strcpy(addr.sun_path,"/dev/lircd");
fd = socket(AF_UNIX, SOCK_STREAM, 0);
+ if(fd == -1)
+ {
+ QMessageBox *mb = new QMessageBox("Error!",
+ "couldnt connect to socket",
+ QMessageBox::NoIcon,
+ QMessageBox::Ok,
+ QMessageBox::NoButton,
+ QMessageBox::NoButton);
+ mb->exec();
+ perror("ButtonDialog::GetRemotes");
+ return NULL;
+ }
if(std::connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1)
{
@@ -158,6 +170,19 @@ QStringList ButtonDialog::getButtons(const char *remoteName)
write_buffer += '\n';
fd = socket(AF_UNIX, SOCK_STREAM, 0);
+ if(fd == -1)
+ {
+ QMessageBox *mb = new QMessageBox("Error!",
+ "couldnt connect to socket",
+ QMessageBox::NoIcon,
+ QMessageBox::Ok,
+ QMessageBox::NoButton,
+ QMessageBox::NoButton);
+ mb->exec();
+ perror("ButtonDialog::GetButtons");
+ return NULL;
+ }
+
if(std::connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1)
{