rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | diff --git a/system/core/init/service.cpp b/system/core/init/service.cpp |
| 2 | index 20c2c9a..ac4070c 100644 |
| 3 | --- a/system/core/init/service.cpp |
| 4 | +++ b/system/core/init/service.cpp |
| 5 | @@ -280,20 +280,20 @@ private: |
| 6 | Service::OptionHandlerMap::Map& Service::OptionHandlerMap::map() const { |
| 7 | constexpr std::size_t kMax = std::numeric_limits<std::size_t>::max(); |
| 8 | static const Map option_handlers = { |
| 9 | - {"class", {1, 1, &Service::HandleClass}}, |
| 10 | - {"console", {0, 1, &Service::HandleConsole}}, |
| 11 | - {"critical", {0, 0, &Service::HandleCritical}}, |
| 12 | - {"disabled", {0, 0, &Service::HandleDisabled}}, |
| 13 | - {"group", {1, NR_SVC_SUPP_GIDS + 1, &Service::HandleGroup}}, |
| 14 | - {"ioprio", {2, 2, &Service::HandleIoprio}}, |
| 15 | - {"keycodes", {1, kMax, &Service::HandleKeycodes}}, |
| 16 | - {"oneshot", {0, 0, &Service::HandleOneshot}}, |
| 17 | - {"onrestart", {1, kMax, &Service::HandleOnrestart}}, |
| 18 | - {"seclabel", {1, 1, &Service::HandleSeclabel}}, |
| 19 | - {"setenv", {2, 2, &Service::HandleSetenv}}, |
| 20 | - {"socket", {3, 6, &Service::HandleSocket}}, |
| 21 | - {"user", {1, 1, &Service::HandleUser}}, |
| 22 | - {"writepid", {1, kMax, &Service::HandleWritepid}}, |
| 23 | + {"class", std::make_tuple(1, 1, &Service::HandleClass)}, |
| 24 | + {"console", std::make_tuple(0, 1, &Service::HandleConsole)}, |
| 25 | + {"critical", std::make_tuple(0, 0, &Service::HandleCritical)}, |
| 26 | + {"disabled", std::make_tuple(0, 0, &Service::HandleDisabled)}, |
| 27 | + {"group", std::make_tuple(1, NR_SVC_SUPP_GIDS + 1, &Service::HandleGroup)}, |
| 28 | + {"ioprio", std::make_tuple(2, 2, &Service::HandleIoprio)}, |
| 29 | + {"keycodes", std::make_tuple(1, kMax, &Service::HandleKeycodes)}, |
| 30 | + {"oneshot", std::make_tuple(0, 0, &Service::HandleOneshot)}, |
| 31 | + {"onrestart", std::make_tuple(1, kMax, &Service::HandleOnrestart)}, |
| 32 | + {"seclabel", std::make_tuple(1, 1, &Service::HandleSeclabel)}, |
| 33 | + {"setenv", std::make_tuple(2, 2, &Service::HandleSetenv)}, |
| 34 | + {"socket", std::make_tuple(3, 6, &Service::HandleSocket)}, |
| 35 | + {"user", std::make_tuple(1, 1, &Service::HandleUser)}, |
| 36 | + {"writepid", std::make_tuple(1, kMax, &Service::HandleWritepid)}, |
| 37 | }; |
| 38 | return option_handlers; |
| 39 | } |
| 40 | @@ -407,7 +407,7 @@ bool Service::Start() { |
| 41 | for (const auto& ei : envvars_) { |
| 42 | add_environment(ei.name.c_str(), ei.value.c_str()); |
| 43 | } |
| 44 | - |
| 45 | + mkdir("/dev/socket", 0755); |
| 46 | for (const auto& si : sockets_) { |
| 47 | int socket_type = ((si.type == "stream" ? SOCK_STREAM : |
| 48 | (si.type == "dgram" ? SOCK_DGRAM : |