mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
rpcdump: Don't call CSocket::connect() before setting up hooks
This commit is contained in:
parent
99970d7d4b
commit
8c8fecd6bf
Notes:
sideshowbarker
2024-07-19 12:09:32 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/8c8fecd6bfd
1 changed files with 7 additions and 5 deletions
|
@ -1,6 +1,7 @@
|
|||
#include <LibCore/CEventLoop.h>
|
||||
#include <LibCore/CLocalSocket.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
|
@ -14,11 +15,6 @@ int main(int argc, char** argv)
|
|||
int pid = atoi(argv[1]);
|
||||
|
||||
CLocalSocket socket;
|
||||
auto success = socket.connect(CSocketAddress::local(String::format("/tmp/rpc.%d", pid)));
|
||||
if (!success) {
|
||||
fprintf(stderr, "Couldn't connect to PID %d\n", pid);
|
||||
return 1;
|
||||
}
|
||||
|
||||
socket.on_connected = [&] {
|
||||
dbg() << "Connected to PID " << pid;
|
||||
|
@ -38,5 +34,11 @@ int main(int argc, char** argv)
|
|||
printf("\n");
|
||||
};
|
||||
|
||||
auto success = socket.connect(CSocketAddress::local(String::format("/tmp/rpc.%d", pid)));
|
||||
if (!success) {
|
||||
fprintf(stderr, "Couldn't connect to PID %d\n", pid);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return loop.exec();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue