summaryrefslogtreecommitdiff
path: root/src/udev/scsi_id
diff options
context:
space:
mode:
authorShawn Landden <shawnlandden@gmail.com>2012-07-25 14:55:59 -0700
committerKay Sievers <kay@vrfy.org>2012-07-26 11:48:26 +0200
commit0d0f0c50d3a1d90f03972a6abb82e6413daaa583 (patch)
tree74f41c8455dbd78599f49300315a2569a8989992 /src/udev/scsi_id
parente146e4516b9ea9907852e7ad609de39dca9e8769 (diff)
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
Diffstat (limited to 'src/udev/scsi_id')
-rw-r--r--src/udev/scsi_id/scsi_id.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/udev/scsi_id/scsi_id.c b/src/udev/scsi_id/scsi_id.c
index 0bb1bc495a..b1e089cb7c 100644
--- a/src/udev/scsi_id/scsi_id.c
+++ b/src/udev/scsi_id/scsi_id.c
@@ -198,8 +198,7 @@ static int get_file_options(struct udev *udev,
buffer = malloc(MAX_BUFFER_LEN);
if (!buffer) {
fclose(fd);
- log_error("Out of memory.");
- return -1;
+ return log_oom();
}
*newargv = NULL;
@@ -231,7 +230,7 @@ static int get_file_options(struct udev *udev,
if (str1 && strcasecmp(str1, "VENDOR") == 0) {
str1 = get_value(&buf);
if (!str1) {
- retval = -1;
+ retval = log_oom();
break;
}
vendor_in = str1;
@@ -240,7 +239,7 @@ static int get_file_options(struct udev *udev,
if (str1 && strcasecmp(str1, "MODEL") == 0) {
str1 = get_value(&buf);
if (!str1) {
- retval = -1;
+ retval = log_oom();
break;
}
model_in = str1;
@@ -251,7 +250,7 @@ static int get_file_options(struct udev *udev,
if (str1 && strcasecmp(str1, "OPTIONS") == 0) {
str1 = get_value(&buf);
if (!str1) {
- retval = -1;
+ retval = log_oom();
break;
}
options_in = str1;
@@ -294,8 +293,7 @@ static int get_file_options(struct udev *udev,
c = argc_count(buffer) + 2;
*newargv = calloc(c, sizeof(**newargv));
if (!*newargv) {
- log_error("Out of memory.");
- retval = -1;
+ retval = log_oom();
} else {
*argc = c;
c = 0;