treewide: more log_*_errno() conversions, multiline calls

Basically:

find . -name '*.[ch]' | while read f; do perl -i.mmm -e \
'local $/;
 local $_=<>;
 s/log_(debug|info|notice|warning|error|emergency)\("([^"]*)%s"([^;]*),\s*strerror\(-?([->a-zA-Z_]+)\)\);/log_\1_errno(\4, "\2%m"\3);/gms;print;' \
 $f; done

Plus manual indentation fixups.
This commit is contained in:
Michal Schmidt
2014-11-28 17:17:51 +01:00
parent 5567fafbc9
commit c33b329709
40 changed files with 232 additions and 278 deletions
+8 -8
View File
@@ -194,8 +194,8 @@ static int parse_argv(int argc, char *argv[]) {
case 'f':
r = safe_atod(optarg, &arg_hz);
if (r < 0)
log_warning("failed to parse --freq/-f argument '%s': %s",
optarg, strerror(-r));
log_warning_errno(r, "failed to parse --freq/-f argument '%s': %m",
optarg);
break;
case 'F':
arg_filter = false;
@@ -209,8 +209,8 @@ static int parse_argv(int argc, char *argv[]) {
case 'n':
r = safe_atoi(optarg, &arg_samples_len);
if (r < 0)
log_warning("failed to parse --samples/-n argument '%s': %s",
optarg, strerror(-r));
log_warning_errno(r, "failed to parse --samples/-n argument '%s': %m",
optarg);
break;
case 'o':
path_kill_slashes(optarg);
@@ -226,14 +226,14 @@ static int parse_argv(int argc, char *argv[]) {
case 'x':
r = safe_atod(optarg, &arg_scale_x);
if (r < 0)
log_warning("failed to parse --scale-x/-x argument '%s': %s",
optarg, strerror(-r));
log_warning_errno(r, "failed to parse --scale-x/-x argument '%s': %m",
optarg);
break;
case 'y':
r = safe_atod(optarg, &arg_scale_y);
if (r < 0)
log_warning("failed to parse --scale-y/-y argument '%s': %s",
optarg, strerror(-r));
log_warning_errno(r, "failed to parse --scale-y/-y argument '%s': %m",
optarg);
break;
case 'e':
arg_entropy = true;