diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-02-03 04:47:32 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-02-03 05:06:04 +0100 |
commit | e1770af8122a74ee21036e16976cac3f223fe0b2 (patch) | |
tree | 474bb3a2cc25bf2aa98361329ef2a60c9c79bbd6 /src/swap.h | |
parent | 067d72c9fe698d305a07db17fc5b328e4a17cc8f (diff) |
swap: replace failure boolean by result enum
Diffstat (limited to 'src/swap.h')
-rw-r--r-- | src/swap.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/swap.h b/src/swap.h index ea98bc2a6f..62d08da30b 100644 --- a/src/swap.h +++ b/src/swap.h @@ -56,6 +56,17 @@ typedef struct SwapParameters { bool handle:1; } SwapParameters; +typedef enum SwapResult { + SWAP_SUCCESS, + SWAP_FAILURE_RESOURCES, + SWAP_FAILURE_TIMEOUT, + SWAP_FAILURE_EXIT_CODE, + SWAP_FAILURE_SIGNAL, + SWAP_FAILURE_CORE_DUMP, + _SWAP_RESULT_MAX, + _SWAP_RESULT_INVALID = -1 +} SwapResult; + struct Swap { Unit meta; @@ -69,13 +80,13 @@ struct Swap { bool from_proc_swaps:1; bool from_fragment:1; - bool failure:1; - /* Used while looking for swaps that vanished or got added * from/to /proc/swaps */ bool is_active:1; bool just_activated:1; + SwapResult result; + usec_t timeout_usec; ExecCommand exec_command[_SWAP_EXEC_COMMAND_MAX]; @@ -111,4 +122,7 @@ SwapState swap_state_from_string(const char *s); const char* swap_exec_command_to_string(SwapExecCommand i); SwapExecCommand swap_exec_command_from_string(const char *s); +const char* swap_result_to_string(SwapResult i); +SwapResult swap_result_from_string(const char *s); + #endif |