[PATCH v2] tests: add getsid.test
Dmitry V. Levin
ldv at altlinux.org
Wed Apr 20 11:52:26 UTC 2016
On Wed, Apr 20, 2016 at 04:17:22PM +0800, Fei Jie wrote:
> diff --git a/tests/getsid.c b/tests/getsid.c
> new file mode 100644
> index 0000000..fbe1a56
> --- /dev/null
> +++ b/tests/getsid.c
> @@ -0,0 +1,23 @@
> +#include "tests.h"
> +#include <sys/syscall.h>
sys/syscall.h is not needed
> +#ifdef __NR_getsid
ifdef is not needed
> +# include <stdio.h>
> +# include <unistd.h>
> +
> +int
> +main(void)
> +{
> + pid_t pid = getpid();;
Why ";;"?
> + printf("getsid(%d) = %d\n", pid, getsid(pid));
> +
> + puts("+++ exited with 0 +++");
> + return 0;
> +}
Please indent with TAB.
> +#else
> +
> +SKIP_MAIN_UNDEFINED("__NR_getsid")
> +
> +#endif
This is not needed.
--
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20160420/2a72cb15/attachment.bin>
More information about the Strace-devel
mailing list