diff options
author | Filipe Brandenburger <filbranden@google.com> | 2015-08-30 20:46:27 -0700 |
---|---|---|
committer | Filipe Brandenburger <filbranden@google.com> | 2015-08-31 17:15:56 -0700 |
commit | 4b40bc38b495bb0c986e7accf5897b164ccfee4d (patch) | |
tree | 081ad5ca971ce4b49f8d86e75e70ad3c319b5a97 /src/basic/util.h | |
parent | 4457c2279e032832bccd6ec0895105e3d6e192cc (diff) |
util: Declare a cleanup routine for a cpu_set_t
Make use of it in config_parse_cpu_affinity2.
Tested by tweaking the `CPUAffinity' setting in /etc/systemd/system.conf
and reloading the daemon to confirm it is working as expected.
No regressions observed in test cases.
Diffstat (limited to 'src/basic/util.h')
-rw-r--r-- | src/basic/util.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/basic/util.h b/src/basic/util.h index 1484ef58e5..ff7a00e928 100644 --- a/src/basic/util.h +++ b/src/basic/util.h @@ -363,6 +363,9 @@ int fd_is_temporary_fs(int fd); int pipe_eof(int fd); +DEFINE_TRIVIAL_CLEANUP_FUNC(cpu_set_t*, CPU_FREE); +#define _cleanup_cpu_free_ _cleanup_(CPU_FREEp) + cpu_set_t* cpu_set_malloc(unsigned *ncpus); #define xsprintf(buf, fmt, ...) assert_se((size_t) snprintf(buf, ELEMENTSOF(buf), fmt, __VA_ARGS__) < ELEMENTSOF(buf)) |