Lines Matching refs:error

30 #include "bus-error.h"
103 /* For additional error maps the end marker is actually the end marker */
113 /* For magic ELF error maps, the end marker might
133 static sd_bus_error errno_to_bus_error_const(int error) {
135 if (error < 0)
136 error = -error;
138 switch (error) {
164 return SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_IO_ERROR, "Input/output error");
190 static int errno_to_bus_error_name_new(int error, char **ret) {
194 if (error < 0)
195 error = -error;
197 name = errno_to_name(error);
268 * this, since we at least managed to write the error name */
304 * _need_free < 0 indicates that the error is temporarily const, needs deep copying
305 * _need_free == 0 indicates that the error is perpetually const, needs no deep copying
306 * _need_free > 0 indicates that the error is fully dynamic, needs deep copying
366 static void bus_error_strerror(sd_bus_error *e, int error) {
380 x = strerror_r(error, m, k);
435 _public_ int sd_bus_error_set_errno(sd_bus_error *e, int error) {
437 if (error < 0)
438 error = -error;
441 return -error;
442 if (error == 0)
443 return -error;
448 *e = errno_to_bus_error_const(error);
455 k = errno_to_bus_error_name_new(error, (char**) &e->name);
460 return -error;
466 bus_error_strerror(e, error);
467 return -error;
470 _public_ int sd_bus_error_set_errnofv(sd_bus_error *e, int error, const char *format, va_list ap) {
474 if (error < 0)
475 error = -error;
478 return -error;
479 if (error == 0)
485 *e = errno_to_bus_error_const(error);
492 k = errno_to_bus_error_name_new(error, (char**) &e->name);
507 errno = error; /* Make sure that %m resolves to the specified error */
519 return -error;
526 return -error;
532 bus_error_strerror(e, error);
533 return -error;
536 _public_ int sd_bus_error_set_errnof(sd_bus_error *e, int error, const char *format, ...) {
539 if (error < 0)
540 error = -error;
543 return -error;
544 if (error == 0)
553 r = sd_bus_error_set_errnofv(e, error, format, ap);
559 return sd_bus_error_set_errno(e, error);
562 const char *bus_error_message(const sd_bus_error *e, int error) {
566 * its error messages, so let's override them here */
574 if (error < 0)
575 error = -error;
577 return strerror(error);