SystemServer: Minor #include cleanup in Service.cpp (#3227)

This commit is contained in:
Muhammad Zahalqa 2020-08-20 21:57:39 +03:00 committed by GitHub
parent d4d9222eea
commit 16e86a3dda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,8 +29,7 @@
#include <AK/JsonArray.h>
#include <AK/JsonObject.h>
#include <LibCore/ConfigFile.h>
#include <LibCore/LocalSocket.h>
#include <fcntl.h>
#include <LibCore/Socket.h>
#include <grp.h>
#include <libgen.h>
#include <pwd.h>
@ -168,13 +167,13 @@ void Service::handle_socket_connection()
dbg() << "Ready to read on behalf of " << name();
#endif
if (m_accept_socket_connections) {
int accepted_fd = accept(m_socket_fd, nullptr, nullptr);
if (accepted_fd < 0) {
perror("accept");
return;
}
spawn(accepted_fd);
close(accepted_fd);
int accepted_fd = accept(m_socket_fd, nullptr, nullptr);
if (accepted_fd < 0) {
perror("accept");
return;
}
spawn(accepted_fd);
close(accepted_fd);
} else {
remove_child(*m_socket_notifier);
m_socket_notifier = nullptr;