1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-28 03:25:31 +03:00

basic: adjust wording and wrapping of comments

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-12-28 15:47:08 +01:00
parent 606309d554
commit 3c7af1af7d

View File

@ -1237,8 +1237,6 @@ char *file_in_same_dir(const char *path, const char *filename) {
} }
bool hidden_or_backup_file(const char *filename) { bool hidden_or_backup_file(const char *filename) {
const char *p;
assert(filename); assert(filename);
if (filename[0] == '.' || if (filename[0] == '.' ||
@ -1248,24 +1246,25 @@ bool hidden_or_backup_file(const char *filename) {
endswith(filename, "~")) endswith(filename, "~"))
return true; return true;
p = strrchr(filename, '.'); const char *dot = strrchr(filename, '.');
if (!p) if (!dot)
return false; return false;
/* Please, let's not add more entries to the list below. If external projects think it's a good idea to come up /* Please, let's not add more entries to the list below. If external projects think it's a good idea
* with always new suffixes and that everybody else should just adjust to that, then it really should be on * to come up with always new suffixes and that everybody else should just adjust to that, then it
* them. Hence, in future, let's not add any more entries. Instead, let's ask those packages to instead adopt * really should be on them. Hence, in future, let's not add any more entries. Instead, let's ask
* one of the generic suffixes/prefixes for hidden files or backups, possibly augmented with an additional * those packages to instead adopt one of the generic suffixes/prefixes for hidden files or backups,
* string. Specifically: there's now: * possibly augmented with an additional string. Specifically: there's now:
* *
* The generic suffixes "~" and ".bak" for backup files * The generic suffixes "~" and ".bak" for backup files
* The generic prefix "." for hidden files * The generic prefix "." for hidden files
* *
* Thus, if a new package manager "foopkg" wants its own set of ".foopkg-new", ".foopkg-old", ".foopkg-dist" * Thus, if a new package manager "foopkg" wants its own set of ".foopkg-new", ".foopkg-old",
* or so registered, let's refuse that and ask them to use ".foopkg.new", ".foopkg.old" or ".foopkg~" instead. * ".foopkg-dist" or so registered, let's refuse that and ask them to use ".foopkg.new",
* ".foopkg.old" or ".foopkg~" instead.
*/ */
return STR_IN_SET(p + 1, return STR_IN_SET(dot + 1,
"rpmnew", "rpmnew",
"rpmsave", "rpmsave",
"rpmorig", "rpmorig",
@ -1287,15 +1286,16 @@ bool hidden_or_backup_file(const char *filename) {
bool is_device_path(const char *path) { bool is_device_path(const char *path) {
/* Returns true on paths that likely refer to a device, either by path in sysfs or to something in /dev */ /* Returns true for paths that likely refer to a device, either by path in sysfs or to something in
* /dev. */
return PATH_STARTSWITH_SET(path, "/dev/", "/sys/"); return PATH_STARTSWITH_SET(path, "/dev/", "/sys/");
} }
bool valid_device_node_path(const char *path) { bool valid_device_node_path(const char *path) {
/* Some superficial checks whether the specified path is a valid device node path, all without looking at the /* Some superficial checks whether the specified path is a valid device node path, all without
* actual device node. */ * looking at the actual device node. */
if (!PATH_STARTSWITH_SET(path, "/dev/", "/run/systemd/inaccessible/")) if (!PATH_STARTSWITH_SET(path, "/dev/", "/run/systemd/inaccessible/"))
return false; return false;
@ -1309,8 +1309,8 @@ bool valid_device_node_path(const char *path) {
bool valid_device_allow_pattern(const char *path) { bool valid_device_allow_pattern(const char *path) {
assert(path); assert(path);
/* Like valid_device_node_path(), but also allows full-subsystem expressions, like DeviceAllow= and DeviceDeny= /* Like valid_device_node_path(), but also allows full-subsystem expressions like those accepted by
* accept it */ * DeviceAllow= and DeviceDeny=. */
if (STARTSWITH_SET(path, "block-", "char-")) if (STARTSWITH_SET(path, "block-", "char-"))
return true; return true;
@ -1401,8 +1401,8 @@ bool dot_or_dot_dot(const char *path) {
bool empty_or_root(const char *path) { bool empty_or_root(const char *path) {
/* For operations relative to some root directory, returns true if the specified root directory is redundant, /* For operations relative to some root directory, returns true if the specified root directory is
* i.e. either / or NULL or the empty string or any equivalent. */ * redundant, i.e. either / or NULL or the empty string or any equivalent. */
if (isempty(path)) if (isempty(path))
return true; return true;