Verified Commit 48f9ef06 authored by Karel Koci's avatar Karel Koci 🤘

logging: drop unneeded exit code

I probably had some plan with it but I no longer remember what it was
suppose to been. Instead I just drop it here. It can be reverted later
if needed.

This also correctly sets read field for cookie structure. This has no
effect because we are not reading from it but just to be precise with
our code we set it to know value NULL which means that read is not
available.
parent 7abc6194
......@@ -186,7 +186,7 @@ void log_subproc_open(struct log_subproc *lsp, enum log_subproc_type type, const
lsp->buffer.f = open_memstream(&lsp->buffer.buf, &lsp->buffer.size);
cookie_io_functions_t fncs = {
// LS_FAIL.read = NULL,
.read = NULL,
.write = c_log_subproc_write,
.seek = NULL,
.close = c_log_subproc_close
......@@ -206,7 +206,7 @@ void log_subproc_open(struct log_subproc *lsp, enum log_subproc_type type, const
INFO("%s", message);
}
void log_subproc_close(struct log_subproc *lsp, int exit_code, char **output) {
void log_subproc_close(struct log_subproc *lsp, char **output) {
fclose(lsp->out);
fclose(lsp->err);
fclose(lsp->buffer.f);
......
......@@ -123,6 +123,6 @@ struct log_subproc {
};
void log_subproc_open(struct log_subproc *ls, enum log_subproc_type type, const char *message) __attribute__((nonnull));
void log_subproc_close(struct log_subproc *ls, int exit_code, char **output) __attribute__((nonnull(1)));
void log_subproc_close(struct log_subproc *ls, char **output) __attribute__((nonnull(1)));
#endif
......@@ -220,7 +220,7 @@ int lsubproclc(enum log_subproc_type type, const char *message, char **output, i
log_subproc_open(&lsp, type, message);
FILE *fds[] = {lsp.out, lsp.err};
int ec = subprocloc(timeout, fds, callback, data, cmd, args);
log_subproc_close(&lsp, ec, output);
log_subproc_close(&lsp, output);
return ec;
}
......@@ -233,6 +233,6 @@ int lvsubprocvc(enum log_subproc_type type, const char *message, char **output,
log_subproc_open(&lsp, type, message);
FILE *fds[] = {lsp.out, lsp.err};
int ec = vsubprocvoc(timeout, fds, callback, data, cmd, args);
log_subproc_close(&lsp, ec, output);
log_subproc_close(&lsp, output);
return ec;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment