OSDN Git Service

getpgrp: fix fallback handling
authorMark Salter <msalter@redhat.com>
Thu, 26 Apr 2012 14:14:01 +0000 (10:14 -0400)
committerMike Frysinger <vapier@gentoo.org>
Fri, 27 Apr 2012 02:48:22 +0000 (22:48 -0400)
commit9f096becc4b9a49051eceb6c94a3c088c519c04d
tree1e868e629830b98da8fca2e1892b296c2fc25e8a
parent9756397b620c3880b94b9db3da96892fa952a3cf
getpgrp: fix fallback handling

The test for generating a stub for getpgrp was wrong and would
result in duplicate symbols when building without __NR_getpgrp,
but with __NR_getpgid and __NR_getpid.

A closer look at the getpgrp implementation using getpgid showed
that getpid was being called to pass the current pid to getpgid.
This is unnecessary because passing 0 to getpgid returns the
pgid of the current process.

This patch cleans up the getpgrp implementation and the stub test.

Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
libc/sysdeps/linux/common/getpgrp.c
libc/sysdeps/linux/common/stubs.c