mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 08:25:20 +09:00
tree-wide: insert a space at the end of comments
This commit is contained in:
@@ -720,7 +720,7 @@ int read_full_stream_full(
|
||||
size_t k;
|
||||
|
||||
/* If we shall fail when reading overly large data, then read exactly one byte more than the
|
||||
* specified size at max, since that'll tell us if there's anymore data beyond the limit*/
|
||||
* specified size at max, since that'll tell us if there's anymore data beyond the limit. */
|
||||
if (FLAGS_SET(flags, READ_FULL_FILE_FAIL_WHEN_LARGER) && n_next > size)
|
||||
n_next = size + 1;
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ struct PidRef {
|
||||
|
||||
/* A special pidref value that we are using when a PID shall be automatically acquired from some surrounding
|
||||
* context, for example connection peer. Much like PIDREF_NULL it will be considered unset by
|
||||
* pidref_is_set().*/
|
||||
* pidref_is_set(). */
|
||||
#define PIDREF_AUTOMATIC (const PidRef) { .pid = PID_AUTOMATIC, .fd = -EBADF }
|
||||
|
||||
/* Turns a pid_t into a PidRef structure on-the-fly *without* acquiring a pidfd for it. (As opposed to
|
||||
@@ -70,7 +70,7 @@ bool pidref_equal(PidRef *a, PidRef *b);
|
||||
int pidref_set_pid(PidRef *pidref, pid_t pid);
|
||||
int pidref_set_pidstr(PidRef *pidref, const char *pid);
|
||||
int pidref_set_pidfd(PidRef *pidref, int fd);
|
||||
int pidref_set_pidfd_take(PidRef *pidref, int fd); /* takes ownership of the passed pidfd on success*/
|
||||
int pidref_set_pidfd_take(PidRef *pidref, int fd); /* takes ownership of the passed pidfd on success */
|
||||
int pidref_set_pidfd_consume(PidRef *pidref, int fd); /* takes ownership of the passed pidfd in both success and failure */
|
||||
int pidref_set_parent(PidRef *ret);
|
||||
static inline int pidref_set_self(PidRef *pidref) {
|
||||
|
||||
@@ -631,7 +631,7 @@ int strv_insert(char ***l, size_t position, char *value) {
|
||||
n = strv_length(*l);
|
||||
position = MIN(position, n);
|
||||
|
||||
/* check for overflow and increase*/
|
||||
/* check for overflow and increase */
|
||||
if (n > SIZE_MAX - 2)
|
||||
return -ENOMEM;
|
||||
m = n + 2;
|
||||
|
||||
@@ -1636,7 +1636,7 @@ int mktime_or_timegm_usec(
|
||||
|
||||
assert(tm);
|
||||
|
||||
if (tm->tm_year < 69) /* early check for negative (i.e. before 1970) time_t (Note that in some timezones the epoch is in the year 1969!)*/
|
||||
if (tm->tm_year < 69) /* early check for negative (i.e. before 1970) time_t (Note that in some timezones the epoch is in the year 1969!) */
|
||||
return -ERANGE;
|
||||
if ((usec_t) tm->tm_year > CONST_MIN(USEC_INFINITY / USEC_PER_YEAR, (usec_t) TIME_T_MAX / (365U * 24U * 60U * 60U)) - 1900) /* early check for possible overrun of usec_t or time_t */
|
||||
return -ERANGE;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "efi.h"
|
||||
|
||||
/* This is the actual PE format of the section header*/
|
||||
/* This is the actual PE format of the section header */
|
||||
typedef struct PeSectionHeader {
|
||||
uint8_t Name[8];
|
||||
uint32_t VirtualSize;
|
||||
|
||||
@@ -776,7 +776,7 @@ int exec_context_destroy_mount_ns_dir(Unit *u) {
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
|
||||
/* This is only filled transiently (see mount_in_namespace()), should be empty or even non-existent*/
|
||||
/* This is only filled transiently (see mount_in_namespace()), should be empty or even non-existent. */
|
||||
if (rmdir(p) < 0 && errno != ENOENT)
|
||||
log_unit_debug_errno(u, errno, "Unable to remove propagation dir '%s', ignoring: %m", p);
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ int kmod_setup(void) {
|
||||
{ "virtio_rng", NULL, false, false, has_virtio_rng },
|
||||
|
||||
/* we want early logging to hvc consoles if possible, and make sure systemd-getty-generator
|
||||
* can rely on all consoles being probed already.*/
|
||||
* can rely on all consoles being probed already. */
|
||||
{ "virtio_console", NULL, false, false, has_virtio_console },
|
||||
|
||||
/* Make sure we can send sd-notify messages over vsock as early as possible. */
|
||||
|
||||
@@ -234,7 +234,7 @@ int dnr_parse_svc_params(const uint8_t *option, size_t len, sd_dns_resolver *res
|
||||
/* Mandatory keys must be understood by the client, otherwise the record should be discarded.
|
||||
* Automatic mandatory keys must not appear in the mandatory parameter, so these are all
|
||||
* supplementary. We don't understand any supplementary keys, so if the mandatory parameter
|
||||
* is present, we cannot use this record.*/
|
||||
* is present, we cannot use this record. */
|
||||
case DNS_SVC_PARAM_KEY_MANDATORY:
|
||||
if (plen > 0)
|
||||
return -EBADMSG;
|
||||
|
||||
@@ -16,7 +16,7 @@ typedef struct sd_dns_resolver sd_dns_resolver;
|
||||
typedef enum sd_dns_alpn_flags {
|
||||
/* There isn't really an alpn reserved for Do53 service, but designated resolvers may or may not offer
|
||||
* Do53 service, so we should probably have a flag to represent this capability. Unfortunately DNR
|
||||
* does not indicate the status to us.*/
|
||||
* does not indicate the status to us. */
|
||||
SD_DNS_ALPN_DO53 = 1 << 0,
|
||||
/* SD_DNS_ALPN_HTTP_1_1, "http/1.1" [RFC9112] */
|
||||
SD_DNS_ALPN_HTTP_2_TLS = 1 << 1, /* "h2" [RFC9113] [RFC9461] */
|
||||
|
||||
@@ -2341,7 +2341,7 @@ static int journal_file_append_entry_internal(
|
||||
if (sd_id128_is_null(*seqnum_id))
|
||||
*seqnum_id = f->header->seqnum_id; /* Caller has none assigned, then copy the one from the file */
|
||||
else if (!sd_id128_equal(*seqnum_id, f->header->seqnum_id)) {
|
||||
/* Different seqnum IDs? We can't allow entries from multiple IDs end up in the same journal.*/
|
||||
/* Different seqnum IDs? We can't allow entries from multiple IDs end up in the same journal. */
|
||||
if (le64toh(f->header->n_entries) == 0)
|
||||
f->header->seqnum_id = *seqnum_id; /* Caller has one, and file so far has no entries, then copy the one from the caller */
|
||||
else
|
||||
|
||||
@@ -95,7 +95,7 @@ int rtnl_resolve_ifname_full(
|
||||
|
||||
/* This is similar to if_nametoindex(), but also resolves alternative names and decimal formatted
|
||||
* ifindex too. Returns ifindex, and optionally provides the main interface name and alternative
|
||||
* names.*/
|
||||
* names. */
|
||||
|
||||
if (!rtnl)
|
||||
rtnl = &our_rtnl;
|
||||
|
||||
@@ -51,7 +51,7 @@ typedef enum SessionClass {
|
||||
/* Which session classes can pin our user tracking? */
|
||||
#define SESSION_CLASS_PIN_USER(class) (!IN_SET((class), SESSION_MANAGER, SESSION_MANAGER_EARLY, SESSION_NONE))
|
||||
|
||||
/* Which session classes decide whether system is idle? (should only cover sessions that have input, and are not idle screens themselves)*/
|
||||
/* Which session classes decide whether system is idle? (should only cover sessions that have input, and are not idle screens themselves) */
|
||||
#define SESSION_CLASS_CAN_IDLE(class) (IN_SET((class), SESSION_USER, SESSION_USER_EARLY, SESSION_USER_EARLY_LIGHT, SESSION_USER_LIGHT, SESSION_GREETER))
|
||||
|
||||
/* Which session classes have a lock screen concept? */
|
||||
|
||||
@@ -50,7 +50,7 @@ static int operation_done(sd_event_source *s, const siginfo_t *si, void *userdat
|
||||
/* If o->done set, call it. It sends a response, but can return
|
||||
* an error in which case it expect this code to reply.
|
||||
* If o->done is not set, the default action is to simply return
|
||||
* an error on failure or an empty success message on success.*/
|
||||
* an error on failure or an empty success message on success. */
|
||||
|
||||
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
|
||||
if (o->done)
|
||||
@@ -73,7 +73,7 @@ static int operation_done(sd_event_source *s, const siginfo_t *si, void *userdat
|
||||
/* If o->done set, call it. Unlike o->message case above, this
|
||||
* code expect o->done to reply in all cases.
|
||||
* If o->done is not set, the default action is to simply return
|
||||
* an error on failure or an empty success message on success.*/
|
||||
* an error on failure or an empty success message on success. */
|
||||
|
||||
if (o->done)
|
||||
(void) o->done(o, r, /* error = */ NULL);
|
||||
|
||||
@@ -1375,7 +1375,7 @@ static int ndisc_router_process_hop_limit(Link *link, sd_ndisc_router *rt) {
|
||||
* the first Router Advertisement was received.
|
||||
*
|
||||
* If the received Cur Hop Limit value is non-zero, the host SHOULD set
|
||||
* its CurHopLimit variable to the received value.*/
|
||||
* its CurHopLimit variable to the received value. */
|
||||
if (hop_limit <= 0)
|
||||
return 0;
|
||||
|
||||
|
||||
@@ -894,7 +894,7 @@ static bool nexthop_can_update(const NextHop *assigned_nexthop, const NextHop *r
|
||||
|
||||
/* There are several more conditions if we can replace a group nexthop, e.g. hash threshold and
|
||||
* resilience. But, currently we do not support to modify that. Let's add checks for them in the
|
||||
* future when we support to configure them.*/
|
||||
* future when we support to configure them. */
|
||||
|
||||
/* When a nexthop is replaced with a blackhole nexthop, and a group nexthop has multiple nexthops
|
||||
* including this nexthop, then the kernel refuses to replace the existing nexthop.
|
||||
|
||||
@@ -511,7 +511,7 @@ static int dns_cache_put_positive(
|
||||
/* If StaleRetentionSec is greater than zero, the 'until' property is set to a duration
|
||||
* of StaleRetentionSec from the time of TTL expiry.
|
||||
* If StaleRetentionSec is zero, both the 'until' and 'until_valid' are set to the TTL duration,
|
||||
* leading to the eviction of the record once the TTL expires.*/
|
||||
* leading to the eviction of the record once the TTL expires. */
|
||||
usec_t until_valid = calculate_until_valid(rr, min_ttl, UINT32_MAX, timestamp, false);
|
||||
*i = (DnsCacheItem) {
|
||||
.type = DNS_CACHE_POSITIVE,
|
||||
|
||||
@@ -1831,7 +1831,7 @@ int dns_packet_read_rr(
|
||||
return r;
|
||||
|
||||
/* RFC 2181, Section 8, suggests to treat a TTL with the MSB set as a zero TTL. We avoid doing this
|
||||
* for OPT records so that all 8 bits of the extended RCODE may be used .*/
|
||||
* for OPT records so that all 8 bits of the extended RCODE may be used. */
|
||||
if (key->type != DNS_TYPE_OPT && rr->ttl & UINT32_C(0x80000000))
|
||||
rr->ttl = 0;
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ int efi_loader_get_entries(char ***ret) {
|
||||
return r;
|
||||
|
||||
/* The variable contains a series of individually NUL terminated UTF-16 strings. We gracefully
|
||||
* consider the final NUL byte optional (i.e. the last string may or may not end in a NUL byte).*/
|
||||
* consider the final NUL byte optional (i.e. the last string may or may not end in a NUL byte). */
|
||||
|
||||
for (size_t i = 0, start = 0;; i++) {
|
||||
_cleanup_free_ char *decoded = NULL;
|
||||
|
||||
@@ -206,7 +206,7 @@ static int protofile_print_item(
|
||||
* delimiter. To work around this limitation, mkfs.xfs allows escaping whitespace by using the /
|
||||
* character (which isn't allowed in filenames and as such can be used to escape whitespace). See
|
||||
* https://lore.kernel.org/linux-xfs/20230222090303.h6tujm7y32gjhgal@andromeda/T/#m8066b3e7d62a080ee7434faac4861d944e64493b
|
||||
* for more information.*/
|
||||
* for more information. */
|
||||
|
||||
if (strchr(de->d_name, ' ')) {
|
||||
copy = strdup(de->d_name);
|
||||
|
||||
@@ -426,7 +426,7 @@ static int insert_window_title_fix(PTYForward *f, size_t offset) {
|
||||
if (!f->osc_sequence)
|
||||
return 0;
|
||||
|
||||
const char *t = startswith(f->osc_sequence, "0;"); /* Set window title OSC sequence*/
|
||||
const char *t = startswith(f->osc_sequence, "0;"); /* Set window title OSC sequence */
|
||||
if (!t)
|
||||
return 0;
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ int sd_rtnl_message_new_routing_policy_rule(sd_netlink *rtnl, sd_netlink_message
|
||||
int sd_rtnl_message_routing_policy_rule_get_family(sd_netlink_message *m, int *ret); /* family */
|
||||
int sd_rtnl_message_routing_policy_rule_set_dst_prefixlen(sd_netlink_message *m, uint8_t prefixlen); /* dst_len */
|
||||
int sd_rtnl_message_routing_policy_rule_get_dst_prefixlen(sd_netlink_message *m, uint8_t *ret);
|
||||
int sd_rtnl_message_routing_policy_rule_set_src_prefixlen(sd_netlink_message *m, uint8_t prefixlen); /* src_len*/
|
||||
int sd_rtnl_message_routing_policy_rule_set_src_prefixlen(sd_netlink_message *m, uint8_t prefixlen); /* src_len */
|
||||
int sd_rtnl_message_routing_policy_rule_get_src_prefixlen(sd_netlink_message *m, uint8_t *ret);
|
||||
int sd_rtnl_message_routing_policy_rule_set_tos(sd_netlink_message *m, uint8_t tos); /* tos */
|
||||
int sd_rtnl_message_routing_policy_rule_get_tos(sd_netlink_message *m, uint8_t *ret);
|
||||
|
||||
@@ -70,7 +70,7 @@ __extension__ typedef enum _SD_ENUM_TYPE_S64(sd_varlink_field_type_t) {
|
||||
SD_VARLINK_STRING,
|
||||
SD_VARLINK_OBJECT,
|
||||
SD_VARLINK_ENUM_VALUE,
|
||||
_SD_VARLINK_FIELD_COMMENT, /* Not really a field, just a comment about a field*/
|
||||
_SD_VARLINK_FIELD_COMMENT, /* Not really a field, just a comment about a field */
|
||||
_SD_VARLINK_FIELD_TYPE_MAX,
|
||||
_SD_VARLINK_FIELD_TYPE_INVALID = -EINVAL,
|
||||
_SD_ENUM_FORCE_S64(SD_VARLINK_FIELD)
|
||||
|
||||
@@ -831,7 +831,7 @@ static int update_render_progress(sd_event_source *source, void *userdata) {
|
||||
|
||||
if (!terminal_is_dumb()) {
|
||||
for (size_t i = 0; i <= n; i++)
|
||||
fputs("\n", stderr); /* Possibly scroll the terminal to make room (including total)*/
|
||||
fputs("\n", stderr); /* Possibly scroll the terminal to make room (including total) */
|
||||
|
||||
fprintf(stderr, "\e[%zuF", n+1); /* Go back */
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ static int check_path(int dir_fd, const char *path) {
|
||||
if (isempty(path))
|
||||
return -EINVAL;
|
||||
|
||||
/* assume length of pathname is not greater than 40*/
|
||||
/* assume length of pathname is not greater than 40 */
|
||||
if (strlen(path) > 40)
|
||||
return -ENAMETOOLONG;
|
||||
|
||||
@@ -60,7 +60,7 @@ static int post_labelling_func(int dir_fd, const char *path, bool created) {
|
||||
}
|
||||
|
||||
static int get_dir_fd(const char *dir_path, mode_t mode) {
|
||||
/* create a new directory and return its descriptor*/
|
||||
/* create a new directory and return its descriptor */
|
||||
int dir_fd = -EBADF;
|
||||
|
||||
assert(dir_path);
|
||||
@@ -83,12 +83,12 @@ static int labelling_op(int dir_fd, const char *text, const char *path, mode_t m
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Error in pathname =>: %m");
|
||||
|
||||
/* Open the file within the directory for writing*/
|
||||
/* Open the file within the directory for writing */
|
||||
write_fd = RET_NERRNO(openat(dir_fd, path, O_CLOEXEC|O_WRONLY|O_TRUNC|O_CREAT, 0644));
|
||||
if (write_fd < 0)
|
||||
return log_error_errno(write_fd, "Error in opening directory for writing =>: %m");
|
||||
|
||||
/* Write data to the file*/
|
||||
/* Write data to the file */
|
||||
count = RET_NERRNO(write(write_fd, text, strlen(text)));
|
||||
if (count < 0)
|
||||
return log_error_errno(count, "Error occurred while opening file for writing =>: %m");
|
||||
|
||||
@@ -61,7 +61,7 @@ TEST(mempool_trim) {
|
||||
|
||||
mempool_trim(&test_mempool);
|
||||
|
||||
/* free everything from the original set*/
|
||||
/* free everything from the original set */
|
||||
|
||||
for (size_t i = 0; i < NN; i += 1) {
|
||||
assert_se(!a[i] || a[i]->value == i);
|
||||
|
||||
@@ -1200,7 +1200,7 @@ TEST(strspn_from_end) {
|
||||
}
|
||||
|
||||
TEST(streq_skip_trailing_chars) {
|
||||
/* NULL is WHITESPACE by default*/
|
||||
/* NULL is WHITESPACE by default */
|
||||
assert_se(streq_skip_trailing_chars("foo bar", "foo bar", NULL));
|
||||
assert_se(streq_skip_trailing_chars("foo", "foo", NULL));
|
||||
assert_se(streq_skip_trailing_chars("foo bar ", "foo bar", NULL));
|
||||
|
||||
@@ -575,7 +575,7 @@ static int verify_source_vc(char **ret_path, const char *src_vc) {
|
||||
|
||||
/* setfont(8) silently ignores when the font can't be applied due to the vc being in
|
||||
* KD_GRAPHICS. Hence we continue to accept this case however we now let the user know that the vc
|
||||
* will be initialized only partially.*/
|
||||
* will be initialized only partially. */
|
||||
r = verify_vc_display_mode(fd);
|
||||
if (r < 0)
|
||||
log_notice_errno(r, "Virtual console %s is not in KD_TEXT, font settings likely won't be applied.", src_vc);
|
||||
|
||||
Reference in New Issue
Block a user