1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 20:20:35 +00:00

Fix receiver if the System V message queue is not available (Fixes: #361)

This commit is contained in:
Carles Fernandez 2020-03-10 19:56:13 +01:00
parent 5efa2f65a4
commit f233184a31
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D

View File

@ -63,6 +63,8 @@
#include <gnuradio/io_signature.h> // for io_signature #include <gnuradio/io_signature.h> // for io_signature
#include <pmt/pmt_sugar.h> // for mp #include <pmt/pmt_sugar.h> // for mp
#include <algorithm> // for sort, unique #include <algorithm> // for sort, unique
#include <cerrno> // for errno
#include <cstring> // for strerror
#include <exception> // for exception #include <exception> // for exception
#include <fstream> // for ofstream #include <fstream> // for ofstream
#include <iomanip> // for put_time, setprecision #include <iomanip> // for put_time, setprecision
@ -412,8 +414,8 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels,
int msgflg = IPC_CREAT | 0666; int msgflg = IPC_CREAT | 0666;
if ((sysv_msqid = msgget(sysv_msg_key, msgflg)) == -1) if ((sysv_msqid = msgget(sysv_msg_key, msgflg)) == -1)
{ {
std::cout << "GNSS-SDR can not create message queues!" << std::endl; std::cout << "GNSS-SDR cannot create System V message queues." << std::endl;
throw std::exception(); LOG(WARNING) << "The System V message queue is not available. Error: " << errno << " - " << strerror(errno) << std::endl;
} }
// Display time in local time zone // Display time in local time zone
@ -486,8 +488,11 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels,
rtklib_pvt_gs::~rtklib_pvt_gs() rtklib_pvt_gs::~rtklib_pvt_gs()
{
if (sysv_msqid != -1)
{ {
msgctl(sysv_msqid, IPC_RMID, nullptr); msgctl(sysv_msqid, IPC_RMID, nullptr);
}
try try
{ {
if (d_xml_storage) if (d_xml_storage)
@ -1677,6 +1682,8 @@ void rtklib_pvt_gs::clear_ephemeris()
bool rtklib_pvt_gs::send_sys_v_ttff_msg(ttff_msgbuf ttff) bool rtklib_pvt_gs::send_sys_v_ttff_msg(ttff_msgbuf ttff)
{
if (sysv_msqid != -1)
{ {
// Fill Sys V message structures // Fill Sys V message structures
int msgsend_size; int msgsend_size;
@ -1690,6 +1697,8 @@ bool rtklib_pvt_gs::send_sys_v_ttff_msg(ttff_msgbuf ttff)
msgsnd(sysv_msqid, &msg, msgsend_size, IPC_NOWAIT); msgsnd(sysv_msqid, &msg, msgsend_size, IPC_NOWAIT);
return true; return true;
} }
return false;
}
bool rtklib_pvt_gs::save_gnss_synchro_map_xml(const std::string& file_name) bool rtklib_pvt_gs::save_gnss_synchro_map_xml(const std::string& file_name)