mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-03-13 05:33:55 -04:00
Apply 3 suggestion(s) to 1 file(s)
Co-authored-by: Barnabás Pőcze <pobrn@protonmail.com>
This commit is contained in:
parent
aac3c14d43
commit
8361526317
1 changed files with 3 additions and 9 deletions
|
|
@ -320,7 +320,6 @@ static bool is_usb_interface_dir(const char *name)
|
||||||
static char *check_wireless_status_at_path(struct impl *this, const char *path)
|
static char *check_wireless_status_at_path(struct impl *this, const char *path)
|
||||||
{
|
{
|
||||||
char wireless_path[PATH_MAX];
|
char wireless_path[PATH_MAX];
|
||||||
char *result;
|
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
res = spa_scnprintf(wireless_path, sizeof(wireless_path),
|
res = spa_scnprintf(wireless_path, sizeof(wireless_path),
|
||||||
|
|
@ -331,10 +330,7 @@ static char *check_wireless_status_at_path(struct impl *this, const char *path)
|
||||||
if (access(wireless_path, R_OK) < 0)
|
if (access(wireless_path, R_OK) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
result = strdup(wireless_path);
|
return strdup(wireless_path);
|
||||||
if (!result)
|
|
||||||
spa_log_error(this->log, "failed to allocate wireless_status path");
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *search_siblings_for_wireless_status(struct impl *this, const char *parent_path)
|
static char *search_siblings_for_wireless_status(struct impl *this, const char *parent_path)
|
||||||
|
|
@ -424,8 +420,7 @@ static void update_wireless_status(struct impl *this, struct card *card)
|
||||||
if (status == WIRELESS_STATUS_UNKNOWN) {
|
if (status == WIRELESS_STATUS_UNKNOWN) {
|
||||||
spa_log_info(this->log, "card %u wireless_status unreadable, removing monitor",
|
spa_log_info(this->log, "card %u wireless_status unreadable, removing monitor",
|
||||||
card->card_nr);
|
card->card_nr);
|
||||||
free(card->wireless_status_path);
|
spa_clear_ptr(card->wireless_status_path, free);
|
||||||
card->wireless_status_path = NULL;
|
|
||||||
card->wireless_disconnected = false;
|
card->wireless_disconnected = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -1093,8 +1088,7 @@ static struct card *find_card_by_wireless_status_path(struct impl *this, const c
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
for (unsigned int i = 0; i < this->n_cards; i++) {
|
for (unsigned int i = 0; i < this->n_cards; i++) {
|
||||||
if (this->cards[i].wireless_status_path &&
|
if (spa_streq(this->cards[i].wireless_status_path, wireless_path))
|
||||||
spa_streq(this->cards[i].wireless_status_path, wireless_path))
|
|
||||||
return &this->cards[i];
|
return &this->cards[i];
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue