- mdev-helper: formatting code using astyle

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2021-07-05 22:39:39 +02:00
committed by Thilo Graf
parent 7dcd1d92fc
commit 16ac40a022

View File

@@ -64,13 +64,15 @@ int main (int /*argc*/, char **argv)
goto _error; goto _error;
} }
for (unsigned i = 0; mdev_env[i]; i++) { for (unsigned i = 0; mdev_env[i]; i++)
{
char *s = getenv(mdev_env[i]); char *s = getenv(mdev_env[i]);
if (s) if (s)
data += std::string(mdev_env[i]) + "=" + s + " "; data += std::string(mdev_env[i]) + "=" + s + " ";
} }
if (data.empty()) { if (data.empty())
{
printf("%s: env data empty\n", argv[0]); printf("%s: env data empty\n", argv[0]);
goto _error; goto _error;
} }
@@ -81,12 +83,14 @@ int main (int /*argc*/, char **argv)
head.initiatorID = CEventServer::INITID_NEUTRINO; head.initiatorID = CEventServer::INITID_NEUTRINO;
head.dataSize = data.size() + 1; head.dataSize = data.size() + 1;
if (write(sock_fd, &head, sizeof(head)) != sizeof(head)) { if (write(sock_fd, &head, sizeof(head)) != sizeof(head))
{
perror("write event"); perror("write event");
goto _error; goto _error;
} }
if (write(sock_fd, data.c_str(), head.dataSize) != (ssize_t) head.dataSize) { if (write(sock_fd, data.c_str(), head.dataSize) != (ssize_t) head.dataSize)
{
perror("write data"); perror("write data");
goto _error; goto _error;
} }