diff options
| author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-02-25 12:52:48 +0000 |
|---|---|---|
| committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-02-25 12:52:48 +0000 |
| commit | a23a88c8822def3a025fde613631b67191ea9ae0 (patch) | |
| tree | 8f52ea07a65ee949c88d9d0d98cbbb438f926229 /usr/src/cmd/svc/startd/method.c | |
| parent | 540be08e437ce290999b29a244386a4283dca907 (diff) | |
| parent | 6a1a5bb98a625f9f7115565ac77e5c4170a030cc (diff) | |
| download | illumos-joyent-a23a88c8822def3a025fde613631b67191ea9ae0.tar.gz | |
[illumos-gate merge]
commit 6a1a5bb98a625f9f7115565ac77e5c4170a030cc
10133 smatch fixes for usr/src/cmd/fs.d
commit 86fec011b9215dec3869eac1fc39dc1aa9307340
10414 loader: move libzfs to libstand and clean up Makefiles
commit eef4f27b270242808b43b4b23bd161df52839361
8928 Want open source bnx
commit 57aea9348dbfeb813b16956eec292357525e2f66
10429 loader: dereferencing type-punned pointer will break strict-aliasing rules
commit 54bc10fe6ad8a64fc279dc5fba56eaafea7ec2c0
10421 bofi: cast between incompatible function types
commit 4bf63a956d4991cc5b0ead02fdea0b65bad10e78
10428 loader: really fix cd9660 dirmatch
commit f18d8787c0ba765f61b003e2aae78db90b48f833
7928 Add support for SMF_EXIT_NODAEMON
Conflicts:
usr/src/cmd/svc/startd/method.c
usr/src/cmd/nscd/svc-nscd
usr/src/cmd/dlmgmtd/svc-dlmgmtd
exception_lists/cstyle
Diffstat (limited to 'usr/src/cmd/svc/startd/method.c')
| -rw-r--r-- | usr/src/cmd/svc/startd/method.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/usr/src/cmd/svc/startd/method.c b/usr/src/cmd/svc/startd/method.c index 1d8ffaa2b6..915ad42da6 100644 --- a/usr/src/cmd/svc/startd/method.c +++ b/usr/src/cmd/svc/startd/method.c @@ -698,7 +698,7 @@ method_run(restarter_inst_t **instp, int type, int *exit_code) if (inst->ri_mi_deleted) return (ECANCELED); - *exit_code = 0; + *exit_code = SMF_EXIT_OK; assert(0 <= type && type <= 2); mname = method_names[type]; @@ -1034,7 +1034,8 @@ method_run(restarter_inst_t **instp, int type, int *exit_code) } *exit_code = WEXITSTATUS(ret_status); - if (*exit_code != 0 && *exit_code != SMF_EXIT_NODAEMON) { + if (*exit_code != SMF_EXIT_OK && + *exit_code != SMF_EXIT_NODAEMON) { log_error(LOG_WARNING, "%s: Method \"%s\" failed with exit status %d.\n", inst->ri_i.i_fmri, method, WEXITSTATUS(ret_status)); @@ -1044,7 +1045,7 @@ method_run(restarter_inst_t **instp, int type, int *exit_code) "%d.", mname, *exit_code); /* Note: we will take this path for SMF_EXIT_NODAEMON */ - if (*exit_code != 0) + if (*exit_code != SMF_EXIT_OK) goto contract_out; end_time = time(NULL); @@ -1095,7 +1096,7 @@ contract_out: * SMF_EXIT_NODAEMON & methods that fail. */ transient = method_is_transient(inst, type); - if ((transient || *exit_code != 0 || result != 0) && + if ((transient || *exit_code != SMF_EXIT_OK || result != 0) && (restarter_is_kill_method(method) < 0)) method_remove_contract(inst, !transient, B_TRUE); @@ -1191,7 +1192,8 @@ retry: r = method_run(&inst, info->sf_method_type, &exit_code); - if (r == 0 && (exit_code == 0 || exit_code == SMF_EXIT_NODAEMON)) { + if (r == 0 && + (exit_code == SMF_EXIT_OK || exit_code == SMF_EXIT_NODAEMON)) { /* Success! */ assert(inst->ri_i.i_next_state != RESTARTER_STATE_NONE); |
