r = get_boots(j, NULL, &boot_id, arg_boot_offset);
assert(r <= 1);
if (r <= 0) {
- const char *reason = (r == 0) ? "No such boot ID in journal" : strerror_safe(r);
+ const char *reason = (r == 0) ? "No such boot ID in journal" : STRERROR(r);
if (sd_id128_is_null(arg_boot_id))
log_error("Data from the specified boot (%+i) is not available: %s",
assert_se(!sd_bus_error_is_set(&error));
assert_se(sd_bus_error_set_errno(&error, EBUSY) == -EBUSY);
assert_se(streq(error.name, "System.Error.EBUSY"));
- assert_se(streq(error.message, strerror_safe(EBUSY)));
+ assert_se(streq(error.message, STRERROR(EBUSY)));
assert_se(sd_bus_error_has_name(&error, "System.Error.EBUSY"));
assert_se(sd_bus_error_get_errno(&error) == EBUSY);
assert_se(sd_bus_error_is_set(&error));
u = now(CLOCK_REALTIME);
r = calendar_spec_next_usec(c, u, &u);
- log_info("Next: %s", r < 0 ? strerror_safe(r) : FORMAT_TIMESTAMP(u));
+ log_info("Next: %s", r < 0 ? STRERROR(r) : FORMAT_TIMESTAMP(u));
calendar_spec_free(c);
assert_se(calendar_spec_from_string(p, &c) >= 0);
u = after;
r = calendar_spec_next_usec(c, after, &u);
- log_info("At: %s", r < 0 ? strerror_safe(r) : FORMAT_TIMESTAMP_STYLE(u, TIMESTAMP_US));
+ log_info("At: %s", r < 0 ? STRERROR(r) : FORMAT_TIMESTAMP_STYLE(u, TIMESTAMP_US));
if (expect != USEC_INFINITY)
assert_se(r >= 0 && u == expect);
else
assert_se((r = calendar_spec_next_usec(c, n, &u)) >= 0);
log_info("Now: %s (%"PRIu64")", FORMAT_TIMESTAMP_STYLE(n, TIMESTAMP_US), n);
- log_info("Next hourly: %s (%"PRIu64")", r < 0 ? strerror_safe(r) : FORMAT_TIMESTAMP_STYLE(u, TIMESTAMP_US), u);
+ log_info("Next hourly: %s (%"PRIu64")", r < 0 ? STRERROR(r) : FORMAT_TIMESTAMP_STYLE(u, TIMESTAMP_US), u);
assert_se((r = calendar_spec_next_usec(c, u, &w)) >= 0);
- log_info("Next hourly: %s (%"PRIu64")", r < 0 ? strerror_safe(r) : FORMAT_TIMESTAMP_STYLE(w, TIMESTAMP_US), w);
+ log_info("Next hourly: %s (%"PRIu64")", r < 0 ? STRERROR(r) : FORMAT_TIMESTAMP_STYLE(w, TIMESTAMP_US), w);
assert_se(n < u);
assert_se(u <= n + USEC_PER_HOUR);
int r;
r = path_extract_filename(input, &k);
- log_info_errno(r, "%s → %s/%m [expected: %s/%s]",
- strnull(input),
- strnull(k), /* strerror(r) is printed via %m, to avoid that the two strerror()'s overwrite each other's buffers */
- strnull(output), ret < 0 ? strerror_safe(ret) : "-");
+ log_info("%s → %s/%s [expected: %s/%s]",
+ strnull(input),
+ strnull(k), r < 0 ? STRERROR(r) : "-",
+ strnull(output), ret < 0 ? STRERROR(ret) : "-");
assert_se(streq_ptr(k, output));
assert_se(r == ret);
}
int r;
r = path_extract_directory(input, &k);
- log_info_errno(r, "%s → %s/%m [expected: %s/%s]",
- strnull(input),
- strnull(k), /* we output strerror_safe(r) via %m here, since otherwise the error buffer might be overwritten twice */
- strnull(output), strerror_safe(ret));
+ log_info("%s → %s/%s [expected: %s/%s]",
+ strnull(input),
+ strnull(k), r < 0 ? STRERROR(r) : "-",
+ strnull(output), STRERROR(ret));
assert_se(streq_ptr(k, output));
assert_se(r == ret);
log_info("/= high-level sleep verbs =/");
r = can_sleep(SLEEP_SUSPEND);
- log_info("Suspend configured and possible: %s", r >= 0 ? yes_no(r) : strerror_safe(r));
+ log_info("Suspend configured and possible: %s", r >= 0 ? yes_no(r) : STRERROR(r));
r = can_sleep(SLEEP_HIBERNATE);
- log_info("Hibernation configured and possible: %s", r >= 0 ? yes_no(r) : strerror_safe(r));
+ log_info("Hibernation configured and possible: %s", r >= 0 ? yes_no(r) : STRERROR(r));
r = can_sleep(SLEEP_HYBRID_SLEEP);
- log_info("Hybrid-sleep configured and possible: %s", r >= 0 ? yes_no(r) : strerror_safe(r));
+ log_info("Hybrid-sleep configured and possible: %s", r >= 0 ? yes_no(r) : STRERROR(r));
r = can_sleep(SLEEP_SUSPEND_THEN_HIBERNATE);
- log_info("Suspend-then-Hibernate configured and possible: %s", r >= 0 ? yes_no(r) : strerror_safe(r));
+ log_info("Suspend-then-Hibernate configured and possible: %s", r >= 0 ? yes_no(r) : STRERROR(r));
}
static int intro(void) {
int r;
r = tempfn_random(p, extra, &s);
- log_info_errno(r, "%s+%s → %s vs. %s (%i/%m vs. %i/%s)", p, strna(extra), strna(s), strna(expect), r, ret, strerror_safe(ret));
+ log_info("%s+%s → %s vs. %s (%i/%s vs. %i/%s)",
+ p, strna(extra), strna(s), strna(expect),
+ r, STRERROR(r), ret, STRERROR(ret));
assert_se(!s == !expect);
if (s) {
int r;
r = tempfn_xxxxxx(p, extra, &s);
- log_info_errno(r, "%s+%s → %s vs. %s (%i/%m vs. %i/%s)", p, strna(extra), strna(s), strna(expect), r, ret, strerror_safe(ret));
+ log_info("%s+%s → %s vs. %s (%i/%s vs. %i/%s)",
+ p, strna(extra), strna(s), strna(expect),
+ r, STRERROR(r), ret, STRERROR(ret));
assert_se(!s == !expect);
if (s) {
int r;
r = tempfn_random_child(p, extra, &s);
- log_info_errno(r, "%s+%s → %s vs. %s (%i/%m vs. %i/%s)", p, strna(extra), strna(s), strna(expect), r, ret, strerror_safe(ret));
+ log_info_errno(r, "%s+%s → %s vs. %s (%i/%s vs. %i/%s)",
+ p, strna(extra), strna(s), strna(expect),
+ r, STRERROR(r), ret, STRERROR(ret));
assert_se(!s == !expect);
if (s) {