mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
node-driver: open PHC as readonly
RW access is usually denied to a user unit. RO might be as well but it's more safe to make /dev/ptpX just user-readable
This commit is contained in:
parent
fffda6b6d1
commit
5edd3f240b
1 changed files with 2 additions and 2 deletions
|
|
@ -588,7 +588,7 @@ impl_init(const struct spa_handle_factory *factory,
|
||||||
if (this->clock_fd >= 0) {
|
if (this->clock_fd >= 0) {
|
||||||
close(this->clock_fd);
|
close(this->clock_fd);
|
||||||
}
|
}
|
||||||
this->clock_fd = open(s, O_RDWR);
|
this->clock_fd = open(s, O_RDONLY);
|
||||||
|
|
||||||
if (this->clock_fd == -1) {
|
if (this->clock_fd == -1) {
|
||||||
spa_log_warn(this->log, "failed to open clock device '%s'", s);
|
spa_log_warn(this->log, "failed to open clock device '%s'", s);
|
||||||
|
|
@ -602,7 +602,7 @@ impl_init(const struct spa_handle_factory *factory,
|
||||||
} else {
|
} else {
|
||||||
char dev[19];
|
char dev[19];
|
||||||
spa_scnprintf(dev, sizeof(dev), "/dev/ptp%d", phc_index);
|
spa_scnprintf(dev, sizeof(dev), "/dev/ptp%d", phc_index);
|
||||||
this->clock_fd = open(dev, O_RDWR);
|
this->clock_fd = open(dev, O_RDONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->clock_fd == -1) {
|
if (this->clock_fd == -1) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue