summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-06-14 18:31:38 +0200
committerFelix Fietkau <nbd@openwrt.org>2015-06-14 18:31:38 +0200
commit09a48623fa914a985770ab17cfbecc2286cfae19 (patch)
tree25ba864002d83204d4b3c84fd895b99c7ef7b5af
parent46954a519259e1818117adee133c119dedbd4523 (diff)
downloadunitd-09a48623fa914a985770ab17cfbecc2286cfae19.tar
unitd-09a48623fa914a985770ab17cfbecc2286cfae19.zip
service: reorder function to avoid forward declaration
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rw-r--r--service/instance.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/service/instance.c b/service/instance.c
index 29fb834..35b2def 100644
--- a/service/instance.c
+++ b/service/instance.c
@@ -295,7 +295,21 @@ instance_run(struct service_instance *in, int _stdout, int _stderr)
exit(127);
}
-static void instance_free_stdio(struct service_instance *in);
+static void
+instance_free_stdio(struct service_instance *in)
+{
+ if (in->_stdout.fd.fd > -1) {
+ ustream_free(&in->_stdout.stream);
+ close(in->_stdout.fd.fd);
+ in->_stdout.fd.fd = -1;
+ }
+
+ if (in->_stderr.fd.fd > -1) {
+ ustream_free(&in->_stderr.stream);
+ close(in->_stderr.fd.fd);
+ in->_stderr.fd.fd = -1;
+ }
+}
void
instance_start(struct service_instance *in)
@@ -823,22 +837,6 @@ instance_update(struct service_instance *in, struct service_instance *in_new)
return true;
}
-static void
-instance_free_stdio(struct service_instance *in)
-{
- if (in->_stdout.fd.fd > -1) {
- ustream_free(&in->_stdout.stream);
- close(in->_stdout.fd.fd);
- in->_stdout.fd.fd = -1;
- }
-
- if (in->_stderr.fd.fd > -1) {
- ustream_free(&in->_stderr.stream);
- close(in->_stderr.fd.fd);
- in->_stderr.fd.fd = -1;
- }
-}
-
void
instance_free(struct service_instance *in)
{