]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
parse-util: rename trivial argument for parse_pid()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 28 Jan 2026 03:37:56 +0000 (12:37 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 3 Feb 2026 12:43:17 +0000 (21:43 +0900)
The function parse_pid() trivially returns pid, hence it is not
necessary to name the argument for storing result as 'ret_pid'.

src/basic/parse-util.c
src/basic/parse-util.h

index 60833d3b06c7ea1f43f4429e6f90ae0751354498..3ccdb0001d19c846c5ba6df88e1ed2833e89d6ad 100644 (file)
@@ -63,7 +63,7 @@ int parse_tristate_full(const char *v, const char *third, int *ret) {
         return 0;
 }
 
-int parse_pid(const char *s, pid_t* ret_pid) {
+int parse_pid(const char *s, pid_t *ret) {
         unsigned long ul = 0;
         pid_t pid;
         int r;
@@ -82,8 +82,8 @@ int parse_pid(const char *s, pid_t* ret_pid) {
         if (!pid_is_valid(pid))
                 return -ERANGE;
 
-        if (ret_pid)
-                *ret_pid = pid;
+        if (ret)
+                *ret = pid;
         return 0;
 }
 
index 153553773dd5d083ae8eaf9d0c5bb5b5adf3bd70..d92577c0fbeffa6bbc6c062051d87615b39c6358 100644 (file)
@@ -10,7 +10,7 @@ int parse_tristate_full(const char *v, const char *third, int *ret);
 static inline int parse_tristate(const char *v, int *ret) {
         return parse_tristate_full(v, NULL, ret);
 }
-int parse_pid(const char *s, pid_t* ret_pid);
+int parse_pid(const char *s, pid_t *ret);
 int parse_mode(const char *s, mode_t *ret);
 int parse_ifindex(const char *s);
 int parse_mtu(int family, const char *s, uint32_t *ret);