mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:37:34 +00:00
rpcdump: Don't call CSocket::connect() before setting up hooks
This commit is contained in:
parent
99970d7d4b
commit
8c8fecd6bf
1 changed files with 7 additions and 5 deletions
|
@ -1,6 +1,7 @@
|
||||||
#include <LibCore/CEventLoop.h>
|
#include <LibCore/CEventLoop.h>
|
||||||
#include <LibCore/CLocalSocket.h>
|
#include <LibCore/CLocalSocket.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
@ -14,11 +15,6 @@ int main(int argc, char** argv)
|
||||||
int pid = atoi(argv[1]);
|
int pid = atoi(argv[1]);
|
||||||
|
|
||||||
CLocalSocket socket;
|
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 = [&] {
|
socket.on_connected = [&] {
|
||||||
dbg() << "Connected to PID " << pid;
|
dbg() << "Connected to PID " << pid;
|
||||||
|
@ -38,5 +34,11 @@ int main(int argc, char** argv)
|
||||||
printf("\n");
|
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();
|
return loop.exec();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue