summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrew Clayton <a.clayton@nginx.com>2022-12-01 21:05:39 +0000
committerAndrew Clayton <a.clayton@nginx.com>2022-12-01 21:05:39 +0000
commit7d7b5a977c4e461976422c59f4594280b05dde0a (patch)
tree768238fdc903b94471ec91d240f7926134a35bfb
parent58812e74d3a0ab14b528933e1953ae28c8f9f627 (diff)
downloadunit-7d7b5a977c4e461976422c59f4594280b05dde0a.tar.gz
unit-7d7b5a977c4e461976422c59f4594280b05dde0a.tar.bz2
Remove the nxt_getpid() alias.
Since the previous commit, nxt_getpid() is only ever aliased to getpid(2). nxt_getpid() was only used once in the code, while there are multiple direct uses of getpid(2) $ grep -r "getpid()" src/ src/nxt_unit.c: nxt_unit_pid = getpid(); src/nxt_process.c: nxt_pid = nxt_getpid(); src/nxt_process.c: nxt_pid = getpid(); src/nxt_lib.c: nxt_pid = getpid(); src/nxt_process.h:#define nxt_getpid() \ src/nxt_process.h:#define nxt_getpid() \ src/nxt_process.h: getpid() Just remove it and convert the _single_ instance of nxt_getpid() to getpid(2). Reviewed-by: Alejandro Colomar <alx@nginx.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
-rw-r--r--src/nxt_process.c2
-rw-r--r--src/nxt_process.h3
2 files changed, 1 insertions, 4 deletions
diff --git a/src/nxt_process.c b/src/nxt_process.c
index a2980350..fe9349e8 100644
--- a/src/nxt_process.c
+++ b/src/nxt_process.c
@@ -269,7 +269,7 @@ nxt_process_child_fixup(nxt_task_t *task, nxt_process_t *process)
nxt_ppid = nxt_pid;
- nxt_pid = nxt_getpid();
+ nxt_pid = getpid();
process->pid = nxt_pid;
process->isolated_pid = nxt_pid;
diff --git a/src/nxt_process.h b/src/nxt_process.h
index de54e383..16d6110c 100644
--- a/src/nxt_process.h
+++ b/src/nxt_process.h
@@ -13,9 +13,6 @@
#endif
-#define nxt_getpid() \
- getpid()
-
typedef pid_t nxt_pid_t;