diff mbox series

[1/3] syscalls/fchmod*: Fix compiler warnings

Message ID 1519977744-1595-1-git-send-email-huangjh.jy@cn.fujitsu.com
State Accepted
Headers show
Series [1/3] syscalls/fchmod*: Fix compiler warnings | expand

Commit Message

Jinhui huang March 2, 2018, 8:02 a.m. UTC
Signed-off-by: Jinhui Huang <huangjh.jy@cn.fujitsu.com>
---
 testcases/kernel/syscalls/fchmod/fchmod05.c | 4 ++--
 testcases/kernel/syscalls/fchmod/fchmod07.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Petr Vorel March 5, 2018, 7:48 a.m. UTC | #1
Hi Jinhui,

> Signed-off-by: Jinhui Huang <huangjh.jy@cn.fujitsu.com>
> ---
>  testcases/kernel/syscalls/fchmod/fchmod05.c | 4 ++--
>  testcases/kernel/syscalls/fchmod/fchmod07.c | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)

> diff --git a/testcases/kernel/syscalls/fchmod/fchmod05.c b/testcases/kernel/syscalls/fchmod/fchmod05.c
> index 7a27028..cdd3d07 100644
> --- a/testcases/kernel/syscalls/fchmod/fchmod05.c
> +++ b/testcases/kernel/syscalls/fchmod/fchmod05.c
> @@ -220,8 +220,8 @@ void cleanup(void)
>  	/* Close the test directory opened in the setup() */
>  	SAFE_CLOSE(NULL, fd);

> -	setegid(0);
> -	seteuid(0);
> +	SAFE_SETEGID(NULL, 0);
> +	SAFE_SETEUID(NULL, 0);

>  	tst_rmdir();

> diff --git a/testcases/kernel/syscalls/fchmod/fchmod07.c b/testcases/kernel/syscalls/fchmod/fchmod07.c
> index 66032e4..6973555 100644
> --- a/testcases/kernel/syscalls/fchmod/fchmod07.c
> +++ b/testcases/kernel/syscalls/fchmod/fchmod07.c
> @@ -83,7 +83,7 @@ int fd;				/* file descriptor for testfile */
>  char *TCID = "fchmod07";
>  int TST_TOTAL = 8;		/* Total number of test conditions */

> -int Modes[] = { 0, 07, 070, 0700, 0777, 02777, 04777, 06777 };
> +mode_t Modes[] = { 0, 07, 070, 0700, 0777, 02777, 04777, 06777 };

>  void setup();			/* setup function for the test */
>  void cleanup();			/* cleanup function for the test */
> @@ -93,7 +93,7 @@ int main(int ac, char **av)
>  	struct stat stat_buf;	/* stat(2) struct contents */
>  	int lc;
>  	int ind;		/* counter variable for chmod(2) tests */
> -	int mode;		/* file mode permission */
> +	mode_t mode;		/* file mode permission */

>  	TST_TOTAL = sizeof(Modes) / sizeof(int);
Pushed, thanks!


Kind regards,
Petr
diff mbox series

Patch

diff --git a/testcases/kernel/syscalls/fchmod/fchmod05.c b/testcases/kernel/syscalls/fchmod/fchmod05.c
index 7a27028..cdd3d07 100644
--- a/testcases/kernel/syscalls/fchmod/fchmod05.c
+++ b/testcases/kernel/syscalls/fchmod/fchmod05.c
@@ -220,8 +220,8 @@  void cleanup(void)
 	/* Close the test directory opened in the setup() */
 	SAFE_CLOSE(NULL, fd);
 
-	setegid(0);
-	seteuid(0);
+	SAFE_SETEGID(NULL, 0);
+	SAFE_SETEUID(NULL, 0);
 
 	tst_rmdir();
 
diff --git a/testcases/kernel/syscalls/fchmod/fchmod07.c b/testcases/kernel/syscalls/fchmod/fchmod07.c
index 66032e4..6973555 100644
--- a/testcases/kernel/syscalls/fchmod/fchmod07.c
+++ b/testcases/kernel/syscalls/fchmod/fchmod07.c
@@ -83,7 +83,7 @@  int fd;				/* file descriptor for testfile */
 char *TCID = "fchmod07";
 int TST_TOTAL = 8;		/* Total number of test conditions */
 
-int Modes[] = { 0, 07, 070, 0700, 0777, 02777, 04777, 06777 };
+mode_t Modes[] = { 0, 07, 070, 0700, 0777, 02777, 04777, 06777 };
 
 void setup();			/* setup function for the test */
 void cleanup();			/* cleanup function for the test */
@@ -93,7 +93,7 @@  int main(int ac, char **av)
 	struct stat stat_buf;	/* stat(2) struct contents */
 	int lc;
 	int ind;		/* counter variable for chmod(2) tests */
-	int mode;		/* file mode permission */
+	mode_t mode;		/* file mode permission */
 
 	TST_TOTAL = sizeof(Modes) / sizeof(int);