readd.cpp (c897d8bb66ff98882a5f5c4df5afb94d678f61d4) readd.cpp (043d32306e00484afc446a44789b61869ea14f84)
1/**
2 * Copyright © 2016 IBM Corporation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1/**
2 * Copyright © 2016 IBM Corporation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#include <iostream>
17#include <memory>
16#include "config.h"
17
18#include "argument.hpp"
19#include "mainloop.hpp"
18#include "argument.hpp"
19#include "mainloop.hpp"
20#include "config.h"
21#include "sysfs.hpp"
22
20#include "sysfs.hpp"
21
22#include <iostream>
23#include <memory>
24
23static void exit_with_error(const char* err, char** argv)
24{
25 ArgumentParser::usage(argv);
26 std::cerr << std::endl;
27 std::cerr << "ERROR: " << err << std::endl;
28 exit(-1);
29}
30

--- 35 unchanged lines hidden (view full) ---

66
67 // Determine the physical device sysfs path.
68 auto calloutPath = sysfs::findCalloutPath(path);
69 if (calloutPath.empty())
70 {
71 exit_with_error("Unable to determine callout path.", argv);
72 }
73
25static void exit_with_error(const char* err, char** argv)
26{
27 ArgumentParser::usage(argv);
28 std::cerr << std::endl;
29 std::cerr << "ERROR: " << err << std::endl;
30 exit(-1);
31}
32

--- 35 unchanged lines hidden (view full) ---

68
69 // Determine the physical device sysfs path.
70 auto calloutPath = sysfs::findCalloutPath(path);
71 if (calloutPath.empty())
72 {
73 exit_with_error("Unable to determine callout path.", argv);
74 }
75
74 MainLoop loop(
75 sdbusplus::bus::new_default(),
76 param,
77 path,
78 calloutPath,
79 BUSNAME_PREFIX,
80 SENSOR_ROOT);
76 MainLoop loop(sdbusplus::bus::new_default(), param, path, calloutPath,
77 BUSNAME_PREFIX, SENSOR_ROOT);
81 loop.run();
82
83 return 0;
84}
85
86// vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
78 loop.run();
79
80 return 0;
81}
82
83// vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4