1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

tree-wide: there is no ENOTSUP on linux

Replace ENOTSUP by EOPNOTSUPP as this is what linux actually uses.
This commit is contained in:
David Herrmann 2015-03-13 14:08:00 +01:00
parent 32a568fb90
commit 15411c0cb1
48 changed files with 104 additions and 104 deletions

View File

@ -223,7 +223,7 @@
</varlistentry>
<varlistentry>
<term><constant>-ENOTSUP</constant></term>
<term><constant>-EOPNOTSUPP</constant></term>
<listitem><para>The selected clock is not supported by the event loop implementation.</para></listitem>

View File

@ -291,7 +291,7 @@ int bus_proxy_process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m, SharedPoli
return synthetic_reply_method_errno(m, r, &error);
if (!(creds->mask & SD_BUS_CREDS_SELINUX_CONTEXT))
return synthetic_reply_method_errno(m, -ENOTSUP, NULL);
return synthetic_reply_method_errno(m, -EOPNOTSUPP, NULL);
return synthetic_reply_method_return(m, "y", creds->label, strlen(creds->label));
@ -307,7 +307,7 @@ int bus_proxy_process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m, SharedPoli
return synthetic_reply_method_errno(m, r, &error);
if (!(creds->mask & SD_BUS_CREDS_PID))
return synthetic_reply_method_errno(m, -ENOTSUP, NULL);
return synthetic_reply_method_errno(m, -EOPNOTSUPP, NULL);
return synthetic_reply_method_return(m, "u", (uint32_t) creds->pid);
@ -323,7 +323,7 @@ int bus_proxy_process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m, SharedPoli
return synthetic_reply_method_errno(m, r, &error);
if (!(creds->mask & SD_BUS_CREDS_EUID))
return synthetic_reply_method_errno(m, -ENOTSUP, NULL);
return synthetic_reply_method_errno(m, -EOPNOTSUPP, NULL);
return synthetic_reply_method_return(m, "u", (uint32_t) creds->euid);
@ -360,7 +360,7 @@ int bus_proxy_process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m, SharedPoli
return synthetic_reply_method_errno(m, r, &error);
if (!(creds->mask & SD_BUS_CREDS_UNIQUE_NAME))
return synthetic_reply_method_errno(m, -ENOTSUP, NULL);
return synthetic_reply_method_errno(m, -EOPNOTSUPP, NULL);
return synthetic_reply_method_return(m, "s", creds->unique_name);

View File

@ -160,7 +160,7 @@ int bus_kernel_make_starter(
/* The higher 32bit of the bus_flags fields are considered
* 'incompatible flags'. Refuse them all for now. */
if (hello->bus_flags > 0xFFFFFFFFULL)
return -ENOTSUP;
return -EOPNOTSUPP;
return fd;
}

View File

@ -573,7 +573,7 @@ int job_run_and_invalidate(Job *j) {
r = job_finish_and_invalidate(j, JOB_INVALID, true);
else if (r == -EPROTO)
r = job_finish_and_invalidate(j, JOB_ASSERT, true);
else if (r == -ENOTSUP)
else if (r == -EOPNOTSUPP)
r = job_finish_and_invalidate(j, JOB_UNSUPPORTED, true);
else if (r == -EAGAIN)
job_set_state(j, JOB_WAITING);

View File

@ -373,7 +373,7 @@ int config_parse_socket_listen(const char *unit,
}
if (socket_address_family(&p->address) != AF_LOCAL && p->address.type == SOCK_SEQPACKET) {
log_syntax(unit, LOG_ERR, filename, line, ENOTSUP,
log_syntax(unit, LOG_ERR, filename, line, EOPNOTSUPP,
"Address family not supported, ignoring: %s", rvalue);
return 0;
}

View File

@ -81,7 +81,7 @@ static int specifier_instance_unescaped(char specifier, void *data, void *userda
assert(u);
if (!u->instance)
return -ENOTSUP;
return -EOPNOTSUPP;
n = unit_name_unescape(u->instance);
if (!n)
@ -164,7 +164,7 @@ static int specifier_runtime(char specifier, void *data, void *userdata, char **
else {
e = getenv("XDG_RUNTIME_DIR");
if (!e)
return -ENOTSUP;
return -EOPNOTSUPP;
}
n = strdup(e);
@ -185,7 +185,7 @@ static int specifier_user_name(char specifier, void *data, void *userdata, char
c = unit_get_exec_context(u);
if (!c)
return -ENOTSUP;
return -EOPNOTSUPP;
if (u->manager->running_as == SYSTEMD_SYSTEM) {
@ -248,7 +248,7 @@ static int specifier_user_home(char specifier, void *data, void *userdata, char
c = unit_get_exec_context(u);
if (!c)
return -ENOTSUP;
return -EOPNOTSUPP;
if (u->manager->running_as == SYSTEMD_SYSTEM) {
@ -258,7 +258,7 @@ static int specifier_user_home(char specifier, void *data, void *userdata, char
if (!c->user || streq(c->user, "root") || streq(c->user, "0"))
n = strdup("/root");
else
return -ENOTSUP;
return -EOPNOTSUPP;
} else {
@ -296,7 +296,7 @@ static int specifier_user_shell(char specifier, void *data, void *userdata, char
c = unit_get_exec_context(u);
if (!c)
return -ENOTSUP;
return -EOPNOTSUPP;
if (u->manager->running_as == SYSTEMD_SYSTEM) {
@ -306,7 +306,7 @@ static int specifier_user_shell(char specifier, void *data, void *userdata, char
if (!c->user || streq(c->user, "root") || streq(c->user, "0"))
n = strdup("/bin/sh");
else
return -ENOTSUP;
return -EOPNOTSUPP;
} else {

View File

@ -1456,7 +1456,7 @@ int unit_start(Unit *u) {
}
if (UNIT_VTABLE(u)->supported && !UNIT_VTABLE(u)->supported(u->manager))
return -ENOTSUP;
return -EOPNOTSUPP;
/* If it is stopped, but we cannot start it, then fail */
if (!UNIT_VTABLE(u)->start)
@ -3016,7 +3016,7 @@ int unit_kill(Unit *u, KillWho w, int signo, sd_bus_error *error) {
assert(signo < _NSIG);
if (!UNIT_VTABLE(u)->kill)
return -ENOTSUP;
return -EOPNOTSUPP;
return UNIT_VTABLE(u)->kill(u, w, signo, error);
}

View File

@ -234,7 +234,7 @@ int import_compress_init(ImportCompress *c, ImportCompressType t) {
break;
default:
return -ENOTSUP;
return -EOPNOTSUPP;
}
c->encoding = true;
@ -365,7 +365,7 @@ int import_compress(ImportCompress *c, const void *data, size_t size, void **buf
break;
default:
return -ENOTSUP;
return -EOPNOTSUPP;
}
return 0;
@ -453,7 +453,7 @@ int import_compress_finish(ImportCompress *c, void **buffer, size_t *buffer_size
break;
default:
return -ENOTSUP;
return -EOPNOTSUPP;
}
return 0;

View File

@ -177,7 +177,7 @@ static int normalize_offset(
uint64_t sz, csize_shift, csize_mask;
if (!compressed)
return -ENOTSUP;
return -EOPNOTSUPP;
csize_shift = 64 - 2 - (HEADER_CLUSTER_BITS(header) - 8);
csize_mask = (1ULL << (HEADER_CLUSTER_BITS(header) - 8)) - 1;
@ -216,10 +216,10 @@ static int verify_header(const Header *header) {
if (HEADER_VERSION(header) != 2 &&
HEADER_VERSION(header) != 3)
return -ENOTSUP;
return -EOPNOTSUPP;
if (HEADER_CRYPT_METHOD(header) != 0)
return -ENOTSUP;
return -EOPNOTSUPP;
if (HEADER_CLUSTER_BITS(header) < 9) /* 512K */
return -EBADMSG;
@ -236,7 +236,7 @@ static int verify_header(const Header *header) {
if (HEADER_VERSION(header) == 3) {
if (header->incompatible_features != 0)
return -ENOTSUP;
return -EOPNOTSUPP;
if (HEADER_HEADER_LENGTH(header) < sizeof(Header))
return -EBADMSG;

View File

@ -698,7 +698,7 @@ static int setup_microhttpd_server(RemoteServer *s,
info = MHD_get_daemon_info(d->daemon, MHD_DAEMON_INFO_EPOLL_FD_LINUX_ONLY);
if (!info) {
log_error("µhttp returned NULL daemon info");
r = -ENOTSUP;
r = -EOPNOTSUPP;
goto error;
}

View File

@ -649,7 +649,7 @@ static int save_core(sd_journal *j, int fd, char **path, bool *unlink_temp) {
}
#else
log_error("Cannot decompress file. Compiled without compression support.");
r = -ENOTSUP;
r = -EOPNOTSUPP;
goto error;
#endif
} else {

View File

@ -106,7 +106,7 @@ static int journal_file_get_epoch(JournalFile *f, uint64_t realtime, uint64_t *e
if (f->fss_start_usec == 0 ||
f->fss_interval_usec == 0)
return -ENOTSUP;
return -EOPNOTSUPP;
if (realtime < f->fss_start_usec)
return -ESTALE;
@ -446,7 +446,7 @@ int journal_file_hmac_setup(JournalFile *f) {
e = gcry_md_open(&f->hmac, GCRY_MD_SHA256, GCRY_MD_FLAG_HMAC);
if (e != 0)
return -ENOTSUP;
return -EOPNOTSUPP;
return 0;
}

View File

@ -817,7 +817,7 @@ int journal_file_verify(
return r;
}
#else
return -ENOTSUP;
return -EOPNOTSUPP;
#endif
} else if (f->seal)
return -ENOKEY;
@ -845,7 +845,7 @@ int journal_file_verify(
if (le32toh(f->header->compatible_flags) & ~HEADER_COMPATIBLE_SUPPORTED) {
log_error("Cannot verify file with unknown extensions.");
r = -ENOTSUP;
r = -EOPNOTSUPP;
goto fail;
}

View File

@ -576,7 +576,7 @@ static int parse_argv(int argc, char *argv[]) {
case ARG_INTERVAL:
case ARG_FORCE:
log_error("Forward-secure sealing not available.");
return -ENOTSUP;
return -EOPNOTSUPP;
#endif
case 'p': {
@ -1472,7 +1472,7 @@ finish:
return r;
#else
log_error("Forward-secure sealing not available.");
return -ENOTSUP;
return -EOPNOTSUPP;
#endif
}

View File

@ -54,7 +54,7 @@ int lldp_read_chassis_id(tlv_packet *tlv,
break;
default:
r = -ENOTSUP;
r = -EOPNOTSUPP;
break;
}
@ -106,7 +106,7 @@ int lldp_read_port_id(tlv_packet *tlv,
break;
default:
r = -ENOTSUP;
r = -EOPNOTSUPP;
break;
}

View File

@ -60,7 +60,7 @@ BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map bus_common_errors[] = {
SD_BUS_ERROR_MAP(BUS_ERROR_DEVICE_IS_TAKEN, EINVAL),
SD_BUS_ERROR_MAP(BUS_ERROR_DEVICE_NOT_TAKEN, EINVAL),
SD_BUS_ERROR_MAP(BUS_ERROR_OPERATION_IN_PROGRESS, EINPROGRESS),
SD_BUS_ERROR_MAP(BUS_ERROR_SLEEP_VERB_NOT_SUPPORTED, ENOTSUP),
SD_BUS_ERROR_MAP(BUS_ERROR_SLEEP_VERB_NOT_SUPPORTED, EOPNOTSUPP),
SD_BUS_ERROR_MAP(BUS_ERROR_AUTOMATIC_TIME_SYNC_ENABLED, EALREADY),

View File

@ -622,7 +622,7 @@ int bus_get_name_creds_kdbus(
int r;
if (streq(name, "org.freedesktop.DBus"))
return -ENOTSUP;
return -EOPNOTSUPP;
r = bus_kernel_parse_unique_name(name, &id);
if (r < 0)
@ -875,7 +875,7 @@ _public_ int sd_bus_get_name_creds(
assert_return(bus, -EINVAL);
assert_return(name, -EINVAL);
assert_return((mask & ~SD_BUS_CREDS_AUGMENT) <= _SD_BUS_CREDS_ALL, -ENOTSUP);
assert_return((mask & ~SD_BUS_CREDS_AUGMENT) <= _SD_BUS_CREDS_ALL, -EOPNOTSUPP);
assert_return(mask == 0 || creds, -EINVAL);
assert_return(!bus_pid_changed(bus), -ECHILD);
assert_return(service_name_is_valid(name), -EINVAL);
@ -989,7 +989,7 @@ static int bus_get_owner_creds_dbus1(sd_bus *bus, uint64_t mask, sd_bus_creds **
_public_ int sd_bus_get_owner_creds(sd_bus *bus, uint64_t mask, sd_bus_creds **ret) {
assert_return(bus, -EINVAL);
assert_return((mask & ~SD_BUS_CREDS_AUGMENT) <= _SD_BUS_CREDS_ALL, -ENOTSUP);
assert_return((mask & ~SD_BUS_CREDS_AUGMENT) <= _SD_BUS_CREDS_ALL, -EOPNOTSUPP);
assert_return(ret, -EINVAL);
assert_return(!bus_pid_changed(bus), -ECHILD);

View File

@ -146,7 +146,7 @@ _public_ int sd_bus_creds_new_from_pid(sd_bus_creds **ret, pid_t pid, uint64_t m
int r;
assert_return(pid >= 0, -EINVAL);
assert_return(mask <= _SD_BUS_CREDS_ALL, -ENOTSUP);
assert_return(mask <= _SD_BUS_CREDS_ALL, -EOPNOTSUPP);
assert_return(ret, -EINVAL);
if (pid == 0)
@ -941,7 +941,7 @@ int bus_creds_add_more(sd_bus_creds *c, uint64_t mask, pid_t pid, pid_t tid) {
if (missing & SD_BUS_CREDS_AUDIT_SESSION_ID) {
r = audit_session_from_pid(pid, &c->audit_session_id);
if (r < 0) {
if (r != -ENOTSUP && r != -ENXIO && r != -ENOENT && r != -EPERM && r != -EACCES)
if (r != -EOPNOTSUPP && r != -ENXIO && r != -ENOENT && r != -EPERM && r != -EACCES)
return r;
} else
c->mask |= SD_BUS_CREDS_AUDIT_SESSION_ID;
@ -950,7 +950,7 @@ int bus_creds_add_more(sd_bus_creds *c, uint64_t mask, pid_t pid, pid_t tid) {
if (missing & SD_BUS_CREDS_AUDIT_LOGIN_UID) {
r = audit_loginuid_from_pid(pid, &c->audit_login_uid);
if (r < 0) {
if (r != -ENOTSUP && r != -ENXIO && r != -ENOENT && r != -EPERM && r != -EACCES)
if (r != -EOPNOTSUPP && r != -ENXIO && r != -ENOENT && r != -EPERM && r != -EACCES)
return r;
} else
c->mask |= SD_BUS_CREDS_AUDIT_LOGIN_UID;

View File

@ -40,7 +40,7 @@ BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map bus_standard_errors[] = {
SD_BUS_ERROR_MAP("org.freedesktop.DBus.Error.NoReply", ETIMEDOUT),
SD_BUS_ERROR_MAP("org.freedesktop.DBus.Error.IOError", EIO),
SD_BUS_ERROR_MAP("org.freedesktop.DBus.Error.BadAddress", EADDRNOTAVAIL),
SD_BUS_ERROR_MAP("org.freedesktop.DBus.Error.NotSupported", ENOTSUP),
SD_BUS_ERROR_MAP("org.freedesktop.DBus.Error.NotSupported", EOPNOTSUPP),
SD_BUS_ERROR_MAP("org.freedesktop.DBus.Error.LimitsExceeded", ENOBUFS),
SD_BUS_ERROR_MAP("org.freedesktop.DBus.Error.AccessDenied", EACCES),
SD_BUS_ERROR_MAP("org.freedesktop.DBus.Error.AuthFailed", EACCES),
@ -168,7 +168,7 @@ static sd_bus_error errno_to_bus_error_const(int error) {
case ECONNRESET:
return SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_DISCONNECTED, "Disconnected");
case ENOTSUP:
case EOPNOTSUPP:
return SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_NOT_SUPPORTED, "Not supported");
case EADDRNOTAVAIL:

View File

@ -972,7 +972,7 @@ int bus_kernel_take_fd(sd_bus *b) {
/* The higher 32bit of the bus_flags fields are considered
* 'incompatible flags'. Refuse them all for now. */
if (hello->bus_flags > 0xFFFFFFFFULL) {
r = -ENOTSUP;
r = -EOPNOTSUPP;
goto fail;
}
@ -987,7 +987,7 @@ int bus_kernel_take_fd(sd_bus *b) {
}
if (!bloom || !bloom_validate_parameters((size_t) bloom->size, (unsigned) bloom->n_hash)) {
r = -ENOTSUP;
r = -EOPNOTSUPP;
goto fail;
}
@ -1395,7 +1395,7 @@ int bus_kernel_pop_memfd(sd_bus *bus, void **address, size_t *mapped, size_t *al
assert(allocated);
if (!bus || !bus->is_kernel)
return -ENOTSUP;
return -EOPNOTSUPP;
assert_se(pthread_mutex_lock(&bus->memfd_cache_mutex) >= 0);

View File

@ -420,7 +420,7 @@ static int message_append_reply_cookie(sd_bus_message *m, uint64_t cookie) {
else {
/* 64bit cookies are not supported on dbus1 */
if (cookie > 0xffffffffUL)
return -ENOTSUP;
return -EOPNOTSUPP;
return message_append_field_uint32(m, BUS_MESSAGE_HEADER_REPLY_SERIAL, (uint32_t) cookie);
}
@ -750,7 +750,7 @@ static int message_new_reply(
t->header->flags |= BUS_MESSAGE_NO_REPLY_EXPECTED;
t->reply_cookie = BUS_MESSAGE_COOKIE(call);
if (t->reply_cookie == 0)
return -ENOTSUP;
return -EOPNOTSUPP;
r = message_append_reply_cookie(t, t->reply_cookie);
if (r < 0)
@ -1463,7 +1463,7 @@ static int message_push_fd(sd_bus_message *m, int fd) {
return -EINVAL;
if (!m->allow_fds)
return -ENOTSUP;
return -EOPNOTSUPP;
copy = fcntl(fd, F_DUPFD_CLOEXEC, 3);
if (copy < 0)
@ -2942,7 +2942,7 @@ int bus_message_seal(sd_bus_message *m, uint64_t cookie, usec_t timeout) {
if (cookie > 0xffffffffULL &&
!BUS_MESSAGE_IS_GVARIANT(m))
return -ENOTSUP;
return -EOPNOTSUPP;
/* In vtables the return signature of method calls is listed,
* let's check if they match if this is a response */
@ -4796,7 +4796,7 @@ _public_ int sd_bus_message_read_array(
assert_return(bus_type_is_trivial(type), -EINVAL);
assert_return(ptr, -EINVAL);
assert_return(size, -EINVAL);
assert_return(!BUS_MESSAGE_NEED_BSWAP(m), -ENOTSUP);
assert_return(!BUS_MESSAGE_NEED_BSWAP(m), -EOPNOTSUPP);
r = sd_bus_message_enter_container(m, SD_BUS_TYPE_ARRAY, CHAR_TO_STR(type));
if (r <= 0)

View File

@ -132,7 +132,7 @@ int bus_event_loop_with_idle(
/* Fallback for dbus1 connections: we
* unregister the name and wait for the
* response to come through for it */
if (r == -ENOTSUP) {
if (r == -EOPNOTSUPP) {
/* Inform the service manager that we
* are going down, so that it will
@ -1170,7 +1170,7 @@ int bus_open_transport(BusTransport transport, const char *host, bool user, sd_b
assert(bus);
assert_return((transport == BUS_TRANSPORT_LOCAL) == !host, -EINVAL);
assert_return(transport == BUS_TRANSPORT_LOCAL || !user, -ENOTSUP);
assert_return(transport == BUS_TRANSPORT_LOCAL || !user, -EOPNOTSUPP);
switch (transport) {
@ -1205,7 +1205,7 @@ int bus_open_transport_systemd(BusTransport transport, const char *host, bool us
assert(bus);
assert_return((transport == BUS_TRANSPORT_LOCAL) == !host, -EINVAL);
assert_return(transport == BUS_TRANSPORT_LOCAL || !user, -ENOTSUP);
assert_return(transport == BUS_TRANSPORT_LOCAL || !user, -EOPNOTSUPP);
switch (transport) {
@ -1764,7 +1764,7 @@ static int check_wait_response(BusWaitForJobs *d, bool quiet) {
else if (streq(d->result, "assert"))
r = -EPROTO;
else if (streq(d->result, "unsupported"))
r = -ENOTSUP;
r = -EOPNOTSUPP;
else if (!streq(d->result, "done") && !streq(d->result, "skipped"))
r = -EIO;

View File

@ -1706,7 +1706,7 @@ static int bus_send_internal(sd_bus *bus, sd_bus_message *_m, uint64_t *cookie,
if (r < 0)
return r;
if (r == 0)
return -ENOTSUP;
return -EOPNOTSUPP;
}
/* If the cookie number isn't kept, then we know that no reply
@ -3398,7 +3398,7 @@ _public_ int sd_bus_try_close(sd_bus *bus) {
assert_return(!bus_pid_changed(bus), -ECHILD);
if (!bus->is_kernel)
return -ENOTSUP;
return -EOPNOTSUPP;
if (!BUS_IS_OPEN(bus->state))
return -ENOTCONN;

View File

@ -35,11 +35,11 @@ static void test_error(void) {
};
assert_se(!sd_bus_error_is_set(&error));
assert_se(sd_bus_error_set(&error, SD_BUS_ERROR_NOT_SUPPORTED, "xxx") == -ENOTSUP);
assert_se(sd_bus_error_set(&error, SD_BUS_ERROR_NOT_SUPPORTED, "xxx") == -EOPNOTSUPP);
assert_se(streq(error.name, SD_BUS_ERROR_NOT_SUPPORTED));
assert_se(streq(error.message, "xxx"));
assert_se(sd_bus_error_has_name(&error, SD_BUS_ERROR_NOT_SUPPORTED));
assert_se(sd_bus_error_get_errno(&error) == ENOTSUP);
assert_se(sd_bus_error_get_errno(&error) == EOPNOTSUPP);
assert_se(sd_bus_error_is_set(&error));
sd_bus_error_free(&error);

View File

@ -919,7 +919,7 @@ _public_ int sd_event_add_time(
callback = time_exit_callback;
type = clock_to_event_source_type(clock);
assert_return(type >= 0, -ENOTSUP);
assert_return(type >= 0, -EOPNOTSUPP);
d = event_get_clock_data(e, type);
assert(d);

View File

@ -323,7 +323,7 @@ static int get_path(uint64_t type, char **buffer, const char **ret) {
return from_user_dir("XDG_DESKTOP_DIR", buffer, ret);
}
return -ENOTSUP;
return -EOPNOTSUPP;
}
_public_ int sd_path_home(uint64_t type, const char *suffix, char **path) {
@ -552,7 +552,7 @@ static int get_search(uint64_t type, char ***list) {
NULL);
}
return -ENOTSUP;
return -EOPNOTSUPP;
}
_public_ int sd_path_search(uint64_t type, const char *suffix, char ***paths) {

View File

@ -648,7 +648,7 @@ int sd_rtnl_message_get_family(sd_rtnl_message *m, int *family) {
return 0;
}
return -ENOTSUP;
return -EOPNOTSUPP;
}
int sd_rtnl_message_is_broadcast(sd_rtnl_message *m) {
@ -1560,7 +1560,7 @@ int socket_read_message(sd_rtnl *rtnl) {
/* check that we support this message type */
r = type_system_get_type(NULL, &nl_type, new_msg->nlmsg_type);
if (r < 0) {
if (r == -ENOTSUP)
if (r == -EOPNOTSUPP)
log_debug("sd-rtnl: ignored message with unknown type: %i",
new_msg->nlmsg_type);

View File

@ -443,12 +443,12 @@ int type_system_get_type(const NLTypeSystem *type_system, const NLType **ret, ui
assert(type_system->types);
if (type > type_system->max)
return -ENOTSUP;
return -EOPNOTSUPP;
nl_type = &type_system->types[type];
if (nl_type->type == NLA_UNSPEC)
return -ENOTSUP;
return -EOPNOTSUPP;
*ret = nl_type;
@ -503,7 +503,7 @@ int type_system_union_get_type_system(const NLTypeSystemUnion *type_system_union
type = type_system_union->lookup(key);
if (type < 0)
return -ENOTSUP;
return -EOPNOTSUPP;
assert(type < type_system_union->num);
@ -521,11 +521,11 @@ int type_system_union_protocol_get_type_system(const NLTypeSystemUnion *type_sys
assert(ret);
if (protocol >= type_system_union->num)
return -ENOTSUP;
return -EOPNOTSUPP;
type_system = &type_system_union->type_systems[protocol];
if (type_system->max == 0)
return -ENOTSUP;
return -EOPNOTSUPP;
*ret = type_system;

View File

@ -998,7 +998,7 @@ int sd_rtnl_add_match(sd_rtnl *rtnl,
assert_return(!rtnl_pid_changed(rtnl), -ECHILD);
assert_return(rtnl_message_type_is_link(type) ||
rtnl_message_type_is_addr(type) ||
rtnl_message_type_is_route(type), -ENOTSUP);
rtnl_message_type_is_route(type), -EOPNOTSUPP);
c = new0(struct match_callback, 1);
if (!c)

View File

@ -112,7 +112,7 @@ int manager_handle_action(
if (!supported) {
log_warning("Requested operation not supported, ignoring.");
return -ENOTSUP;
return -EOPNOTSUPP;
}
if (m->action_what) {

View File

@ -461,7 +461,7 @@ int session_activate(Session *s) {
assert(s->user);
if (!s->seat)
return -ENOTSUP;
return -EOPNOTSUPP;
if (s->seat->active == s)
return 0;
@ -469,7 +469,7 @@ int session_activate(Session *s) {
/* on seats with VTs, we let VTs manage session-switching */
if (seat_has_vts(s->seat)) {
if (!s->vtnr)
return -ENOTSUP;
return -EOPNOTSUPP;
return chvt(s->vtnr);
}

View File

@ -1155,7 +1155,7 @@ static int login_machine(int argc, char *argv[], void *userdata) {
if (arg_transport != BUS_TRANSPORT_LOCAL &&
arg_transport != BUS_TRANSPORT_MACHINE) {
log_error("Login only supported on local machines.");
return -ENOTSUP;
return -EOPNOTSUPP;
}
polkit_agent_open_if_enabled();

View File

@ -197,7 +197,7 @@ int main(int argc, char* argv[]) {
}
if (r == 0)
r = -ENOTSUP;
r = -EOPNOTSUPP;
finish:
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;

View File

@ -3125,7 +3125,7 @@ static int dissect_image(
return 0;
#else
log_error("--image= is not supported, compiled without blkid support.");
return -ENOTSUP;
return -EOPNOTSUPP;
#endif
}
@ -3180,7 +3180,7 @@ static int mount_device(const char *what, const char *where, const char *directo
if (streq(fstype, "crypto_LUKS")) {
log_error("nspawn currently does not support LUKS disk images.");
return -ENOTSUP;
return -EOPNOTSUPP;
}
if (mount(what, p, fstype, MS_NODEV|(rw ? 0 : MS_RDONLY), NULL) < 0)
@ -3189,7 +3189,7 @@ static int mount_device(const char *what, const char *where, const char *directo
return 0;
#else
log_error("--image= is not supported, compiled without blkid support.");
return -ENOTSUP;
return -EOPNOTSUPP;
#endif
}

View File

@ -115,7 +115,7 @@ static int print_home(const char *n) {
}
log_error("Path %s not known.", n);
return -ENOTSUP;
return -EOPNOTSUPP;
}
static void help(void) {

View File

@ -144,7 +144,7 @@ int dns_scope_emit(DnsScope *s, DnsPacket *p) {
DnsServer *srv;
if (DNS_PACKET_QDCOUNT(p) > 1)
return -ENOTSUP;
return -EOPNOTSUPP;
srv = dns_scope_get_dns_server(s);
if (!srv)
@ -172,7 +172,7 @@ int dns_scope_emit(DnsScope *s, DnsPacket *p) {
} else if (s->protocol == DNS_PROTOCOL_LLMNR) {
if (DNS_PACKET_QDCOUNT(p) > 1)
return -ENOTSUP;
return -EOPNOTSUPP;
if (!ratelimit_test(&s->ratelimit))
return -EBUSY;

View File

@ -285,7 +285,7 @@ static int fd_copy_directory(
else if (S_ISBLK(buf.st_mode) || S_ISCHR(buf.st_mode))
q = fd_copy_node(dirfd(d), de->d_name, &buf, fdt, de->d_name);
else
q = -ENOTSUP;
q = -EOPNOTSUPP;
if (q == -EEXIST && merge)
q = 0;
@ -317,7 +317,7 @@ int copy_tree_at(int fdf, const char *from, int fdt, const char *to, bool merge)
else if (S_ISBLK(st.st_mode) || S_ISCHR(st.st_mode))
return fd_copy_node(fdf, from, &st, fdt, to);
else
return -ENOTSUP;
return -EOPNOTSUPP;
}
int copy_tree(const char *from, const char *to, bool merge) {

View File

@ -91,10 +91,10 @@ int fw_add_masquerade(
int r;
if (af != AF_INET)
return -ENOTSUP;
return -EOPNOTSUPP;
if (protocol != 0 && protocol != IPPROTO_TCP && protocol != IPPROTO_UDP)
return -ENOTSUP;
return -EOPNOTSUPP;
h = iptc_init("nat");
if (!h)
@ -175,10 +175,10 @@ int fw_add_local_dnat(
assert(add || !previous_remote);
if (af != AF_INET)
return -ENOTSUP;
return -EOPNOTSUPP;
if (protocol != IPPROTO_TCP && protocol != IPPROTO_UDP)
return -ENOTSUP;
return -EOPNOTSUPP;
if (local_port <= 0)
return -EINVAL;

View File

@ -60,7 +60,7 @@ static inline int fw_add_masquerade(
const char *out_interface,
const union in_addr_union *destination,
unsigned destination_prefixlen) {
return -ENOTSUP;
return -EOPNOTSUPP;
}
static inline int fw_add_local_dnat(
@ -76,7 +76,7 @@ static inline int fw_add_local_dnat(
const union in_addr_union *remote,
uint16_t remote_port,
const union in_addr_union *previous_remote) {
return -ENOTSUP;
return -EOPNOTSUPP;
}
#endif

View File

@ -1535,7 +1535,7 @@ int unit_file_add_dependency(
if (state == UNIT_FILE_MASKED || state == UNIT_FILE_MASKED_RUNTIME) {
log_error("Failed to enable unit: Unit %s is masked", *i);
return -ENOTSUP;
return -EOPNOTSUPP;
}
r = install_info_add_auto(&c, *i);
@ -1613,7 +1613,7 @@ int unit_file_enable(
state = unit_file_get_state(scope, root_dir, *i);
if (state == UNIT_FILE_MASKED || state == UNIT_FILE_MASKED_RUNTIME) {
log_error("Failed to enable unit: Unit %s is masked", *i);
return -ENOTSUP;
return -EOPNOTSUPP;
}
r = install_info_add_auto(&c, *i);

View File

@ -369,7 +369,7 @@ int image_remove(Image *i) {
return rm_rf_dangerous(i->path, false, true, false);
default:
return -ENOTSUP;
return -EOPNOTSUPP;
}
}
@ -430,7 +430,7 @@ int image_rename(Image *i, const char *new_name) {
}
default:
return -ENOTSUP;
return -EOPNOTSUPP;
}
if (!new_path)
@ -498,7 +498,7 @@ int image_clone(Image *i, const char *new_name, bool read_only) {
break;
default:
return -ENOTSUP;
return -EOPNOTSUPP;
}
if (r < 0)
@ -563,7 +563,7 @@ int image_read_only(Image *i, bool b) {
}
default:
return -ENOTSUP;
return -EOPNOTSUPP;
}
return 0;
@ -622,7 +622,7 @@ int image_set_limit(Image *i, uint64_t referenced_max) {
return -EROFS;
if (i->type != IMAGE_SUBVOLUME)
return -ENOTSUP;
return -EOPNOTSUPP;
return btrfs_quota_limit(i->path, referenced_max);
}

View File

@ -145,7 +145,7 @@ int mac_selinux_fix(const char *path, bool ignore_enoent, bool ignore_erofs) {
r = lsetfilecon(path, fcon);
/* If the FS doesn't support labels, then exit without warning */
if (r < 0 && errno == ENOTSUP)
if (r < 0 && errno == EOPNOTSUPP)
return 0;
}
}

View File

@ -187,7 +187,7 @@ int mac_smack_fix(const char *path, bool ignore_enoent, bool ignore_erofs) {
r = lsetxattr(path, "security.SMACK64", label, strlen(label), 0);
/* If the FS doesn't support labels, then exit without warning */
if (r < 0 && errno == ENOTSUP)
if (r < 0 && errno == EOPNOTSUPP)
return 0;
}

View File

@ -580,7 +580,7 @@ int sockaddr_pretty(const struct sockaddr *_sa, socklen_t salen, bool translate_
break;
default:
return -ENOTSUP;
return -EOPNOTSUPP;
}

View File

@ -6668,7 +6668,7 @@ int getpeersec(int fd, char **ret) {
if (isempty(s)) {
free(s);
return -ENOTSUP;
return -EOPNOTSUPP;
}
*ret = s;

View File

@ -2618,7 +2618,7 @@ static int expand_names(sd_bus *bus, char **names, const char* suffix, char ***r
_cleanup_free_ UnitInfo *unit_infos = NULL;
if (!bus)
return log_error_errno(ENOTSUP, "Unit name globbing without bus is not implemented.");
return log_error_errno(EOPNOTSUPP, "Unit name globbing without bus is not implemented.");
r = get_unit_list(bus, NULL, globs, &unit_infos, 0, &reply);
if (r < 0)
@ -2956,7 +2956,7 @@ static int start_special(sd_bus *bus, char **args) {
a == ACTION_HIBERNATE ||
a == ACTION_HYBRID_SLEEP)) {
r = reboot_with_logind(bus, a);
if (r >= 0 || IN_SET(r, -ENOTSUP, -EINPROGRESS))
if (r >= 0 || IN_SET(r, -EOPNOTSUPP, -EINPROGRESS))
return r;
}

View File

@ -43,7 +43,7 @@
#define NULL_ADJTIME_LOCAL "0.0 0 0\n0\nLOCAL\n"
static BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map timedated_errors[] = {
SD_BUS_ERROR_MAP("org.freedesktop.timedate1.NoNTPSupport", ENOTSUP),
SD_BUS_ERROR_MAP("org.freedesktop.timedate1.NoNTPSupport", EOPNOTSUPP),
SD_BUS_ERROR_MAP_END
};

View File

@ -753,7 +753,7 @@ static int path_set_acls(Item *item, const char *path) {
if (r > 0)
return -r; /* already warned */
else if (r == -ENOTSUP) {
else if (r == -EOPNOTSUPP) {
log_debug_errno(r, "ACLs not supported by file system at %s", path);
return 0;
} else if (r < 0)