Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2113caea authored by Abhijeet Kaur's avatar Abhijeet Kaur
Browse files

Set close-on-exec flag for bugreportz socket in dumpstate

dumpstate triggers lshal child processes, bugreportz connection socket
fd in dumpstate is passed on to these processes.

Set close-on-exec flag allows to close the socket connection from
dumpstate, even if child processes do not terminate.

Test: `adb bugreport` `adb bugreport BR.zip` works as expected
Bug: 140713872
Change-Id: I4aa07a60110da383110e2e9091c72403351ac3dc
parent ebbe2c45
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3504,7 +3504,7 @@ int open_socket(const char *service) {

    struct sockaddr addr;
    socklen_t alen = sizeof(addr);
    int fd = accept(s, &addr, &alen);
    int fd = accept4(s, &addr, &alen, SOCK_CLOEXEC);

    // Close socket just after accept(), to make sure that connect() by client will get error
    // when the socket is used by the other services.