module: remove ready_fd

All modules are expected to handle a call to content() after having
been instantiated.

I.e. modules *cannot* even expect run() to have started running.
This commit is contained in:
Daniel Eklöf 2019-01-13 15:25:39 +01:00
parent 65cfcfb2de
commit acdeff3b6e
14 changed files with 27 additions and 66 deletions

View file

@ -376,7 +376,6 @@ run(struct module_run_context *ctx)
FILE *out = popen("i3 --get-socketpath", "r");
if (out == NULL) {
LOG_ERRNO("failed to execute 'i3 --get-socketpath'");
module_signal_ready(ctx);
return 1;
}
@ -392,7 +391,6 @@ run(struct module_run_context *ctx)
int sock = socket(AF_UNIX, SOCK_STREAM, 0);
if (sock == -1) {
LOG_ERRNO("failed to create UNIX socket");
module_signal_ready(ctx);
return 1;
}
@ -400,7 +398,6 @@ run(struct module_run_context *ctx)
if (r == -1) {
LOG_ERRNO("failed to connect to i3 socket");
close(sock);
module_signal_ready(ctx);
return 1;
}
@ -408,8 +405,6 @@ run(struct module_run_context *ctx)
send_pkg(sock, I3_IPC_MESSAGE_TYPE_GET_WORKSPACES, NULL);
send_pkg(sock, I3_IPC_MESSAGE_TYPE_SUBSCRIBE, "[\"workspace\"]");
module_signal_ready(ctx);
char buf[1 * 1024 * 1024]; /* Some replies are *big*. TODO: grow dynamically */
size_t buf_idx = 0;