Skip to content

Commit 7d7b5a9

Browse files
committed
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 <[email protected]> Signed-off-by: Andrew Clayton <[email protected]>
1 parent 58812e7 commit 7d7b5a9

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

src/nxt_process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ nxt_process_child_fixup(nxt_task_t *task, nxt_process_t *process)
269269

270270
nxt_ppid = nxt_pid;
271271

272-
nxt_pid = nxt_getpid();
272+
nxt_pid = getpid();
273273

274274
process->pid = nxt_pid;
275275
process->isolated_pid = nxt_pid;

src/nxt_process.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
#endif
1414

1515

16-
#define nxt_getpid() \
17-
getpid()
18-
1916
typedef pid_t nxt_pid_t;
2017

2118

0 commit comments

Comments
 (0)