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:
Shawn Landden
2012-07-26 11:48:26 +02:00
committed by Kay Sievers
parent e146e4516b
commit 0d0f0c50d3
40 changed files with 183 additions and 310 deletions
+4 -4
View File
@@ -343,7 +343,7 @@ int main(int argc, char *argv[]) {
l = strcspn(opt_cipher, "-");
if (!(truncated_cipher = strndup(opt_cipher, l))) {
log_error("Out of memory.");
log_oom();
goto finish;
}
@@ -365,7 +365,7 @@ int main(int argc, char *argv[]) {
char **p;
if (asprintf(&text, "Please enter passphrase for disk %s!", name) < 0) {
log_error("Out of memory.");
log_oom();
goto finish;
}
@@ -383,7 +383,7 @@ int main(int argc, char *argv[]) {
assert(strv_length(passwords) == 1);
if (asprintf(&text, "Please enter passphrase for disk %s! (verification)", name) < 0) {
log_error("Out of memory.");
log_oom();
goto finish;
}
@@ -416,7 +416,7 @@ int main(int argc, char *argv[]) {
/* Pad password if necessary */
if (!(c = new(char, opt_key_size))) {
log_error("Out of memory.");
log_oom();
goto finish;
}