Directly print output over socket

This commit is contained in:
topjohnwu
2018-11-16 01:49:15 -05:00
parent 77fd5fa7de
commit ba70269398
2 changed files with 6 additions and 13 deletions

View File

@@ -247,10 +247,11 @@ bool init_list() {
}
void ls_list(int client) {
write_int(client, DAEMON_SUCCESS);
write_int(client, hide_list.size());
FILE *out = fdopen(recv_fd(client), "a");
for (auto &s : hide_list)
write_string(client, s);
fprintf(out, "%s\n", s.c_str());
fclose(out);
write_int(client, DAEMON_SUCCESS);
close(client);
}