1
0
mirror of https://github.com/systemd/systemd synced 2025-09-28 16:24:45 +02:00

Compare commits

...

3 Commits

Author SHA1 Message Date
A S Alam
b88e599886 Translated using Weblate (Punjabi)
Currently translated at 3.7% (7 of 189 strings)

Co-authored-by: A S Alam <amanpreet.alam@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/pa/
Translation: systemd/main
2021-01-25 14:27:23 +09:00
Daan De Meyer
eb83eb63b8 sd-bus: Add sd_bus_reply()
While sd-bus already provides sd_bus_call() for calling a method
from a complete bus message object, We don't have an equivalent
function for replying from a method with a complete bus message
object.

Currently, we use sd_bus_send(call->bus, m, NULL) instead. Let's
add a shorthand for this pattern and name it sd_bus_reply().
2021-01-25 12:31:17 +09:00
Stefan Agner
237ecfee15 Avoid error when bind mount source already exists 2021-01-25 12:30:36 +09:00
9 changed files with 47 additions and 11 deletions

View File

@ -11,7 +11,6 @@ manpages = [
['coredump.conf', '5', ['coredump.conf.d'], 'ENABLE_COREDUMP'],
['coredumpctl', '1', [], 'ENABLE_COREDUMP'],
['crypttab', '5', [], 'HAVE_LIBCRYPTSETUP'],
['veritytab', '5', [], 'HAVE_LIBCRYPTSETUP'],
['daemon', '7', [], ''],
['dnssec-trust-anchors.d',
'5',
@ -405,7 +404,10 @@ manpages = [
'sd_bus_reply_method_errorf',
'sd_bus_reply_method_errorfv'],
''],
['sd_bus_reply_method_return', '3', ['sd_bus_reply_method_returnv'], ''],
['sd_bus_reply_method_return',
'3',
['sd_bus_reply', 'sd_bus_reply_method_returnv'],
''],
['sd_bus_request_name',
'3',
['sd_bus_release_name',
@ -1128,6 +1130,7 @@ manpages = [
['systemd-user-runtime-dir', 'user-runtime-dir@.service'],
''],
['userdbctl', '1', [], 'ENABLE_USERDB'],
['vconsole.conf', '5', [], 'ENABLE_VCONSOLE']
['vconsole.conf', '5', [], 'ENABLE_VCONSOLE'],
['veritytab', '5', [], 'HAVE_LIBCRYPTSETUP']
]
# Really, do not edit.

View File

@ -144,6 +144,7 @@
<citerefentry><refentrytitle>sd_bus_query_sender_privilege</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_reply_method_return</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_reply_method_error</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_reply</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_request_name</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_send</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_send_to</refentrytitle><manvolnum>3</manvolnum></citerefentry>,

View File

@ -19,6 +19,7 @@
<refnamediv>
<refname>sd_bus_reply_method_return</refname>
<refname>sd_bus_reply_method_returnv</refname>
<refname>sd_bus_reply</refname>
<refpurpose>Reply to a D-Bus method call</refpurpose>
</refnamediv>
@ -40,6 +41,12 @@
<paramdef>const char *<parameter>types</parameter></paramdef>
<paramdef>va_list <parameter>ap</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int sd_bus_reply</funcdef>
<paramdef>const sd_bus_message *<parameter>call</parameter></paramdef>
<paramdef>sd_bus_message *<parameter>m</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
@ -52,6 +59,11 @@
<citerefentry><refentrytitle>sd_bus_message_append</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
If no reply is expected to <parameter>call</parameter>, this function succeeds without sending a
reply.</para>
<para><function>sd_bus_reply()</function> takes a complete bus message object created with either
<citerefentry><refentrytitle>sd_bus_new_method_return</refentrytitle><manvolnum>3</manvolnum></citerefentry> or
<citerefentry><refentrytitle>sd_bus_new_method_error</refentrytitle><manvolnum>3</manvolnum></citerefentry>
and sends it as a reply to the <parameter>call</parameter> message.</para>
</refsect1>
<refsect1>
@ -76,6 +88,8 @@
</para>
<para>Message <parameter>call</parameter> is not attached to a bus.</para>
<para>Message <parameter>m</parameter> is not a method reply message.</para>
</listitem>
</varlistentry>

View File

@ -1,13 +1,13 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the systemd package.
# A S Alam <amanpreet.alam@gmail.com>, 2020.
# A S Alam <amanpreet.alam@gmail.com>, 2020, 2021.
msgid ""
msgstr ""
"Project-Id-Version: systemd\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-01-08 17:48+0100\n"
"PO-Revision-Date: 2020-12-21 07:36+0000\n"
"PO-Revision-Date: 2021-01-24 16:38+0000\n"
"Last-Translator: A S Alam <amanpreet.alam@gmail.com>\n"
"Language-Team: Punjabi <https://translate.fedoraproject.org/projects/systemd/"
"master/pa/>\n"
@ -16,7 +16,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 4.3.2\n"
"X-Generator: Weblate 4.4.2\n"
#: src/core/org.freedesktop.systemd1.policy.in:22
msgid "Send passphrase back to system"
@ -25,7 +25,7 @@ msgstr "ਵਾਕ ਵਾਪਸ ਸਿਸਟਮ ਨੂੰ ਭੇਜੋ"
#: src/core/org.freedesktop.systemd1.policy.in:23
msgid ""
"Authentication is required to send the entered passphrase back to the system."
msgstr "ਦਿੱਤਾ ਵਾਕ ਸਿਸਟਮ ਨੂੰ ਵਾਪਸ ਭੇਜਣ ਲਈ ਪਰਮਾਣਕਿਤਾ ਚਾਹੀਦ ਹੈ।"
msgstr "ਦਿੱਤਾ ਵਾਕ ਸਿਸਟਮ ਨੂੰ ਵਾਪਸ ਭੇਜਣ ਲਈ ਪਰਮਾਣਕਿਤਾ ਚਾਹੀਦ ਹੈ।"
#: src/core/org.freedesktop.systemd1.policy.in:33
msgid "Manage system services or other units"
@ -55,7 +55,7 @@ msgstr ""
#: src/core/org.freedesktop.systemd1.policy.in:64
msgid "Reload the systemd state"
msgstr ""
msgstr "systemd ਹਾਲਤ ਮੁੜ ਲੋਡ ਕਰੋ"
#: src/core/org.freedesktop.systemd1.policy.in:65
msgid "Authentication is required to reload the systemd state."

View File

@ -1010,7 +1010,9 @@ static void mount_enter_mounting(Mount *m) {
p = get_mount_parameters_fragment(m);
if (p && mount_is_bind(p)) {
r = mkdir_p_label(p->what, m->directory_mode);
if (r < 0)
/* mkdir_p_label() can return -EEXIST if the target path exists and is not a directory - which is
* totally OK, in case the user wants us to overmount a non-directory inode. */
if (r < 0 && r != -EEXIST)
log_unit_error_errno(UNIT(m), r, "Failed to make bind mount source '%s': %m", p->what);
}

View File

@ -740,6 +740,7 @@ global:
LIBSYSTEMD_248 {
global:
sd_bus_open_user_machine;
sd_bus_reply;
sd_event_source_set_ratelimit;
sd_event_source_get_ratelimit;

View File

@ -198,7 +198,7 @@ _public_ int sd_bus_reply_method_returnv(
return r;
}
return sd_bus_send(call->bus, m, NULL);
return sd_bus_reply(call, m);
}
_public_ int sd_bus_reply_method_return(
@ -239,7 +239,7 @@ _public_ int sd_bus_reply_method_error(
if (r < 0)
return r;
return sd_bus_send(call->bus, m, NULL);
return sd_bus_reply(call, m);
}
_public_ int sd_bus_reply_method_errorfv(

View File

@ -2604,6 +2604,20 @@ _public_ int sd_bus_get_timeout(sd_bus *bus, uint64_t *timeout_usec) {
}
}
int sd_bus_reply(const sd_bus_message *call, sd_bus_message *reply) {
assert_return(call, -EINVAL);
assert_return(call->sealed, -EPERM);
assert_return(call->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL);
assert_return(call->bus, -EINVAL);
assert_return(!bus_pid_changed(call->bus), -ECHILD);
assert_return(reply, -EINVAL);
assert_return(
IN_SET(reply->header->type, SD_BUS_MESSAGE_METHOD_RETURN, SD_BUS_MESSAGE_METHOD_ERROR),
-EINVAL);
return sd_bus_send(call->bus, reply, NULL);
}
static int process_timeout(sd_bus *bus) {
_cleanup_(sd_bus_error_free) sd_bus_error error_buffer = SD_BUS_ERROR_NULL;
_cleanup_(sd_bus_message_unrefp) sd_bus_message* m = NULL;

View File

@ -201,6 +201,7 @@ int sd_bus_send(sd_bus *bus, sd_bus_message *m, uint64_t *cookie);
int sd_bus_send_to(sd_bus *bus, sd_bus_message *m, const char *destination, uint64_t *cookie);
int sd_bus_call(sd_bus *bus, sd_bus_message *m, uint64_t usec, sd_bus_error *ret_error, sd_bus_message **reply);
int sd_bus_call_async(sd_bus *bus, sd_bus_slot **slot, sd_bus_message *m, sd_bus_message_handler_t callback, void *userdata, uint64_t usec);
int sd_bus_reply(const sd_bus_message *call, sd_bus_message *reply);
int sd_bus_get_fd(sd_bus *bus);
int sd_bus_get_events(sd_bus *bus);