mirror of https://github.com/PentHertz/srsLTE.git
skiq: allow running without root permissions
do what the comment says, when thread can't be created with privelages, try to create it without them.
This commit is contained in:
parent
8d33d93c77
commit
085d561f65
|
@ -209,8 +209,14 @@ int rf_skiq_card_init(rf_skiq_card_t* q, uint8_t card, uint8_t nof_ports, const
|
||||||
// Launch thread
|
// Launch thread
|
||||||
if (pthread_create(&q->thread, &attr, reader_thread, q)) {
|
if (pthread_create(&q->thread, &attr, reader_thread, q)) {
|
||||||
ERROR("Error creating reader thread with attributes (Did you miss sudo?). Trying without attributes.\n");
|
ERROR("Error creating reader thread with attributes (Did you miss sudo?). Trying without attributes.\n");
|
||||||
|
|
||||||
|
// try to create thread without attributes
|
||||||
|
pthread_attr_destroy(&attr);
|
||||||
|
if (pthread_create(&q->thread, NULL, reader_thread, q)) {
|
||||||
|
ERROR("Error creating reader thread, even without thread attributes. Exiting.\n");
|
||||||
return SRSRAN_ERROR;
|
return SRSRAN_ERROR;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Rename thread
|
// Rename thread
|
||||||
char thread_name[32] = {};
|
char thread_name[32] = {};
|
||||||
|
|
|
@ -222,8 +222,14 @@ int rf_skiq_tx_port_init(rf_skiq_tx_port_t* q, uint8_t card, skiq_tx_hdl_t hdl,
|
||||||
// Launch thread
|
// Launch thread
|
||||||
if (pthread_create(&q->thread, &attr, writer_thread, q)) {
|
if (pthread_create(&q->thread, &attr, writer_thread, q)) {
|
||||||
ERROR("Error creating writer thread with attributes (Did you miss sudo?). Trying without attributes.\n");
|
ERROR("Error creating writer thread with attributes (Did you miss sudo?). Trying without attributes.\n");
|
||||||
|
|
||||||
|
// try to create thread without attributes
|
||||||
|
pthread_attr_destroy(&attr);
|
||||||
|
if (pthread_create(&q->thread, NULL, writer_thread, q)) {
|
||||||
|
ERROR("Error creating writer thread, even without thread attributes. Exiting.\n");
|
||||||
return SRSRAN_ERROR;
|
return SRSRAN_ERROR;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Rename thread
|
// Rename thread
|
||||||
char thread_name[32] = {};
|
char thread_name[32] = {};
|
||||||
|
|
Loading…
Reference in New Issue