diff options
| author | Patrick Venture <venture@google.com> | 2018-04-23 19:01:56 -0700 |
|---|---|---|
| committer | Patrick Venture <venture@google.com> | 2018-05-07 08:52:55 -0700 |
| commit | c897d8bb66ff98882a5f5c4df5afb94d678f61d4 (patch) | |
| tree | abc06ff0083b21be7bf4d8906a52f892af89368d /readd.cpp | |
| parent | 0b3050582046e509d517360c413a6f90ca7d9b3a (diff) | |
| download | phosphor-hwmon-c897d8bb66ff98882a5f5c4df5afb94d678f61d4.tar.gz phosphor-hwmon-c897d8bb66ff98882a5f5c4df5afb94d678f61d4.zip | |
mainloop: add uniqueness to busname
There can be multiple daemon instances that have the
same devpath which leads to a collision which errors silently.
This adds uniqueness to the path, which was no longer human-readable
to avoid this collision situation.
Tested: Ran on quanta-q71l with unique devices and two instances
pointing to the same device and it correctly set them up with unique
but deterministic bus names.
Change-Id: Id5aea3c3df5f793b28557a74995608ec40792a43
Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'readd.cpp')
| -rw-r--r-- | readd.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -35,6 +35,7 @@ int main(int argc, char** argv) // Parse out path argument. auto path = (*options)["dev-path"]; + auto param = path; if (path != ArgumentParser::empty_string) { // This path may either be a device path (starts with @@ -52,6 +53,7 @@ int main(int argc, char** argv) if (path == ArgumentParser::empty_string) { path = (*options)["path"]; + param = path; } if (path == ArgumentParser::empty_string) @@ -71,6 +73,7 @@ int main(int argc, char** argv) MainLoop loop( sdbusplus::bus::new_default(), + param, path, calloutPath, BUSNAME_PREFIX, |

