diff --git a/src/driver/toks_amain.c b/src/driver/toks_amain.c index c83737b..7a92ce6 100644 --- a/src/driver/toks_amain.c +++ b/src/driver/toks_amain.c @@ -150,31 +150,6 @@ int toks_main(char ** argv, char ** envp) } } - if (dctx->cctx->drvflags & TOKS_DRIVER_ACTION_ABORT) { - ret = (status = toks_service_abort(dctx)) - ? 2 : 0; - - switch (status) { - case NT_STATUS_SUCCESS: - toks_dprintf(STDERR_FILENO, - "%s: the server responded with no error.\n", - toks_log_basename(argv[0]),status); - break; - - case NT_STATUS_ACCESS_DENIED: - toks_dprintf(STDERR_FILENO, - "%s: the abort operataion timed (access denied) [0x%x].\n", - toks_log_basename(argv[0]),status); - break; - - default: - toks_dprintf(STDERR_FILENO, - "%s: the abort operataion failed ", - "(check the system's documentation) [0x%x].", - toks_log_basename(argv[0]),status); - } - } - if (dctx->cctx->drvflags & TOKS_DRIVER_ACTION_NTOKENS_GET) { toks_dprintf(STDOUT_FILENO, "toks_ntokens:%d\n", @@ -278,6 +253,31 @@ int toks_main(char ** argv, char ** envp) } } + if (dctx->cctx->drvflags & TOKS_DRIVER_ACTION_ABORT) { + ret = (status = toks_service_abort(dctx)) + ? 2 : 0; + + switch (status) { + case NT_STATUS_SUCCESS: + toks_dprintf(STDERR_FILENO, + "%s: the server responded with no error.\n", + toks_log_basename(argv[0]),status); + break; + + case NT_STATUS_ACCESS_DENIED: + toks_dprintf(STDERR_FILENO, + "%s: the abort operataion timed (access denied) [0x%x].\n", + toks_log_basename(argv[0]),status); + break; + + default: + toks_dprintf(STDERR_FILENO, + "%s: the abort operataion failed ", + "(check the system's documentation) [0x%x].", + toks_log_basename(argv[0]),status); + } + } + return (dctx->cctx->drvflags & TOKS_DRIVER_MODE_SERVER) ? NT_STATUS_SERVICE_NOTIFICATION : toks_exit(dctx,ret);