On Sun, Mar 06, 2016 at 08:49:46AM +0000, Anchit Jain wrote:
> From: Anchit Jain <anchitjain1...@gmail.com>
> 
> * tests/chmod.c: New file.
> * tests/chmod.test: New test.
> * tests/.gitignore: Add chmod.
> * tests/Makefile.am (check_PROGRAMS): Likewise.
> (TESTS): Add chmod.test.

This is 5th edition of the patch, and it's close to the final version.
There is a tradition to include iteration count in emails,
see --reroll-count option of git-format-patch(1).

> +int
> +main(void)
> +{
> +     static const char fname[] = "chmod_test_file";
> +
> +     if (open(fname, O_CREAT|O_RDONLY, 0400) == -1)
> +             perror_msg_and_fail("open");
> +
> +     int enosys_flag = 0;
> +     if (syscall(__NR_chmod, fname, 0600) != 0){
> +

Please add a space before the brace, but don't add an empty line after
the brace.

You don't really need a separate flag, the return code is enough.
For example,

        int rc = syscall(__NR_chmod, fname, 0600);
        if (rc == 0) {
                [handle success]
        } else {
                [handle error]
        }
        [unlink]
        if (rc == 0) {
                [more tests]
        }

> +             }
> +             else

Please place "else" on the same line with the brace, like in my example.


-- 
ldv

Attachment: pgpwQuglGMukU.pgp
Description: PGP signature

------------------------------------------------------------------------------
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to