log.h: new log_oom() -> int -ENOMEM, use it
also a number of minor fixups and bug fixes: spelling, oom errors that didn't print errors, not properly forwarding error codes, few more consistency issues, et cetera
This commit is contained in:
committed by
Kay Sievers
parent
e146e4516b
commit
0d0f0c50d3
@@ -49,17 +49,13 @@ static int add_modules(const char *p) {
|
||||
char **t, **k;
|
||||
|
||||
k = strv_split(p, ",");
|
||||
if (!k) {
|
||||
log_error("Out of memory.");
|
||||
return -ENOMEM;
|
||||
}
|
||||
if (!k)
|
||||
return log_oom();
|
||||
|
||||
t = strv_merge(arg_proc_cmdline_modules, k);
|
||||
strv_free(k);
|
||||
if (!t) {
|
||||
log_error("Out of memory.");
|
||||
return -ENOMEM;
|
||||
}
|
||||
if (!t)
|
||||
return log_oom();
|
||||
|
||||
strv_free(arg_proc_cmdline_modules);
|
||||
arg_proc_cmdline_modules = t;
|
||||
|
||||
Reference in New Issue
Block a user