[PATCH 10/10] libtests/POSIX: Fix warnings and style.

Joel Sherrill joel at rtems.org
Fri Aug 10 13:27:06 UTC 2018


---
 testsuites/libtests/POSIX/close.c          |  4 +---
 testsuites/libtests/POSIX/dup2.c           |  4 +---
 testsuites/libtests/POSIX/fcntl.c          | 13 ++++++++-----
 testsuites/libtests/POSIX/flockfile.c      |  1 +
 testsuites/libtests/POSIX/fork.c           |  6 ++++--
 testsuites/libtests/POSIX/free.c           |  5 ++---
 testsuites/libtests/POSIX/fstat.c          |  9 +++++----
 testsuites/libtests/POSIX/ftrylockfile.c   |  4 +++-
 testsuites/libtests/POSIX/funlockfile.c    |  1 +
 testsuites/libtests/POSIX/getdents.c       |  6 +++---
 testsuites/libtests/POSIX/getlogin.c       |  5 +++--
 testsuites/libtests/POSIX/getpwnam.c       |  8 ++++----
 testsuites/libtests/POSIX/getpwuid.c       |  3 +--
 testsuites/libtests/POSIX/gettimeofday.c   |  3 +--
 testsuites/libtests/POSIX/getuid.c         |  7 +++----
 testsuites/libtests/POSIX/htonl.c          |  7 +++++--
 testsuites/libtests/POSIX/iconv.c          |  5 ++---
 testsuites/libtests/POSIX/iconv_close.c    |  5 ++---
 testsuites/libtests/POSIX/iconv_open.c     |  5 ++---
 testsuites/libtests/POSIX/issetugid.c      |  7 +++----
 testsuites/libtests/POSIX/kill.c           | 16 ++++++++++------
 testsuites/libtests/POSIX/longjmp.c        |  5 ++---
 testsuites/libtests/POSIX/lseek.c          | 14 +++++++++-----
 testsuites/libtests/POSIX/lstat.c          |  7 +++----
 testsuites/libtests/POSIX/malloc.c         |  5 ++---
 testsuites/libtests/POSIX/nanosleep.c      |  7 +++----
 testsuites/libtests/POSIX/open.c           |  9 ++++-----
 testsuites/libtests/POSIX/pipe.c           |  7 +++----
 testsuites/libtests/POSIX/posix_memalign.c |  5 ++---
 testsuites/libtests/POSIX/read.c           |  7 +++----
 testsuites/libtests/POSIX/readv.c          |  5 ++---
 testsuites/libtests/POSIX/realloc.c        |  7 +++----
 testsuites/libtests/POSIX/setjmp.c         |  5 ++---
 testsuites/libtests/POSIX/sigaddset.c      |  5 ++---
 testsuites/libtests/POSIX/sigdelset.c      |  5 ++---
 testsuites/libtests/POSIX/sigemptyset.c    |  5 ++---
 testsuites/libtests/POSIX/sigfillset.c     |  5 ++---
 testsuites/libtests/POSIX/sigismember.c    |  3 +--
 testsuites/libtests/POSIX/sigprocmask.c    | 17 ++++++++++-------
 testsuites/libtests/POSIX/stat.c           |  7 +++----
 testsuites/libtests/POSIX/unlink.c         |  4 ++--
 testsuites/libtests/POSIX/vfork.c          |  7 +++----
 testsuites/libtests/POSIX/wait.c           |  5 ++---
 testsuites/libtests/POSIX/waitpid.c        |  6 +++---
 testsuites/libtests/POSIX/write.c          |  7 +++----
 testsuites/libtests/POSIX/writev.c         |  5 ++---
 46 files changed, 140 insertions(+), 148 deletions(-)

diff --git a/testsuites/libtests/POSIX/close.c b/testsuites/libtests/POSIX/close.c
index 5468adc..b770a76 100644
--- a/testsuites/libtests/POSIX/close.c
+++ b/testsuites/libtests/POSIX/close.c
@@ -15,7 +15,5 @@
 int
 main (void)
 {
-  close (42);
-
-  return 0;
+  return close(42);
 }
diff --git a/testsuites/libtests/POSIX/dup2.c b/testsuites/libtests/POSIX/dup2.c
index b090d63..2e5238e 100644
--- a/testsuites/libtests/POSIX/dup2.c
+++ b/testsuites/libtests/POSIX/dup2.c
@@ -18,7 +18,5 @@ main (void)
   int oldfd = 42;
   int newfd = 43;
 
-  dup2 (oldfd, newfd);
-
-  return 0;
+  return dup2 (oldfd, newfd);
 }
diff --git a/testsuites/libtests/POSIX/fcntl.c b/testsuites/libtests/POSIX/fcntl.c
index dc59d5d..9578df4 100644
--- a/testsuites/libtests/POSIX/fcntl.c
+++ b/testsuites/libtests/POSIX/fcntl.c
@@ -13,11 +13,14 @@
 #include <unistd.h>
 #include <fcntl.h>
 
-int
-main (void)
+int main (void)
 {
-  fcntl (42, 43);
-  fcntl (42, 43, 44);
+  int rc;
 
-  return 0;
+  rc = fcntl (42, 43);
+  (void) rc;
+ 
+  rc = fcntl (42, 43, 44);
+
+  return rc;
 }
diff --git a/testsuites/libtests/POSIX/flockfile.c b/testsuites/libtests/POSIX/flockfile.c
index 4d1f23e..01e322c 100644
--- a/testsuites/libtests/POSIX/flockfile.c
+++ b/testsuites/libtests/POSIX/flockfile.c
@@ -15,6 +15,7 @@
 int main(void)
 {
   FILE *file = NULL;
+
   flockfile(file);
   return 0;
 }
diff --git a/testsuites/libtests/POSIX/fork.c b/testsuites/libtests/POSIX/fork.c
index d4392be..e6e233f 100644
--- a/testsuites/libtests/POSIX/fork.c
+++ b/testsuites/libtests/POSIX/fork.c
@@ -15,7 +15,9 @@
 int
 main (void)
 {
-  fork ();
+  int rc;
 
-  return 0;
+  rc = fork();
+
+  return rc;
 }
diff --git a/testsuites/libtests/POSIX/free.c b/testsuites/libtests/POSIX/free.c
index 8473084..8550eaa 100644
--- a/testsuites/libtests/POSIX/free.c
+++ b/testsuites/libtests/POSIX/free.c
@@ -12,10 +12,9 @@
 
 #include <stdlib.h>
 
-int
-main (void)
+int main (void)
 {
-  free ((void *) 42);
+  free((void *) 42);
 
   return 0;
 }
diff --git a/testsuites/libtests/POSIX/fstat.c b/testsuites/libtests/POSIX/fstat.c
index 29c38d6..2798365 100644
--- a/testsuites/libtests/POSIX/fstat.c
+++ b/testsuites/libtests/POSIX/fstat.c
@@ -14,12 +14,13 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-int
-main (void)
+int main (void)
 {
   struct stat buf;
   int fd = 42;
-  fstat (fd, &buf);
+  int rc;
 
-  return 0;
+  rc = fstat(fd, &buf);
+
+  return rc;
 }
diff --git a/testsuites/libtests/POSIX/ftrylockfile.c b/testsuites/libtests/POSIX/ftrylockfile.c
index 8e99406..2a724e6 100644
--- a/testsuites/libtests/POSIX/ftrylockfile.c
+++ b/testsuites/libtests/POSIX/ftrylockfile.c
@@ -15,6 +15,8 @@
 int main(void)
 {
   FILE *file = NULL;
-  int ret = ftrylockfile(file);
+  int ret;
+
+  ret = ftrylockfile(file);
   return ret;
 }
diff --git a/testsuites/libtests/POSIX/funlockfile.c b/testsuites/libtests/POSIX/funlockfile.c
index 571b9e8..0069e07 100644
--- a/testsuites/libtests/POSIX/funlockfile.c
+++ b/testsuites/libtests/POSIX/funlockfile.c
@@ -15,6 +15,7 @@
 int main(void)
 {
   FILE *file = NULL;
+
   funlockfile(file);
   return 0;
 }
diff --git a/testsuites/libtests/POSIX/getdents.c b/testsuites/libtests/POSIX/getdents.c
index bb731e9..fd801c7 100644
--- a/testsuites/libtests/POSIX/getdents.c
+++ b/testsuites/libtests/POSIX/getdents.c
@@ -12,11 +12,11 @@
 
 #include <dirent.h>
 
-int
-main (void)
+int main(void)
 {
   int status;
   int fd = 42;
 
-  status = getdents (fd, "/tmp/foo", 0);
+  status = getdents(fd, "/tmp/foo", 0);
+  return status;
 }
diff --git a/testsuites/libtests/POSIX/getlogin.c b/testsuites/libtests/POSIX/getlogin.c
index f5f38a7..1655056 100644
--- a/testsuites/libtests/POSIX/getlogin.c
+++ b/testsuites/libtests/POSIX/getlogin.c
@@ -12,11 +12,12 @@
 
 #include <unistd.h>
 
-int
-main (void)
+int main(void)
 {
   char *login;
+
   login = getlogin ();
+  (void) login;
 
   return 0;
 }
diff --git a/testsuites/libtests/POSIX/getpwnam.c b/testsuites/libtests/POSIX/getpwnam.c
index c220871..8151dd0 100644
--- a/testsuites/libtests/POSIX/getpwnam.c
+++ b/testsuites/libtests/POSIX/getpwnam.c
@@ -13,11 +13,11 @@
 #include <sys/types.h>
 #include <pwd.h>
 
-int
-main (void)
+int main(void)
 {
   struct passwd *pass;
-  pass = getpwnam ("root");
 
-  return 0;
+  pass = getpwnam("root");
+
+  return (pass != NULL);
 }
diff --git a/testsuites/libtests/POSIX/getpwuid.c b/testsuites/libtests/POSIX/getpwuid.c
index fb4d050..d0ec315 100644
--- a/testsuites/libtests/POSIX/getpwuid.c
+++ b/testsuites/libtests/POSIX/getpwuid.c
@@ -13,8 +13,7 @@
 #include <sys/types.h>
 #include <pwd.h>
 
-int
-main (void)
+int main(void)
 {
   struct passwd *pass;
   pass = getpwnam (0);
diff --git a/testsuites/libtests/POSIX/gettimeofday.c b/testsuites/libtests/POSIX/gettimeofday.c
index f3fa673..8ed8283 100644
--- a/testsuites/libtests/POSIX/gettimeofday.c
+++ b/testsuites/libtests/POSIX/gettimeofday.c
@@ -12,8 +12,7 @@
 
 #include <sys/time.h>
 
-int
-main (void)
+int main(void)
 {
   struct timeval tv;
   struct timezone tz;
diff --git a/testsuites/libtests/POSIX/getuid.c b/testsuites/libtests/POSIX/getuid.c
index d4b942c..490a9c7 100644
--- a/testsuites/libtests/POSIX/getuid.c
+++ b/testsuites/libtests/POSIX/getuid.c
@@ -13,11 +13,10 @@
 #include <unistd.h>
 #include <sys/types.h>
 
-int
-main (void)
+int main(void)
 {
   uid_t uid;
-  uid = getuid ();
+  uid = getuid();
 
-  return 0;
+  return (uid != 0);
 }
diff --git a/testsuites/libtests/POSIX/htonl.c b/testsuites/libtests/POSIX/htonl.c
index ecdaa9c..9ebc768 100644
--- a/testsuites/libtests/POSIX/htonl.c
+++ b/testsuites/libtests/POSIX/htonl.c
@@ -12,17 +12,20 @@
 
 #include <arpa/inet.h>
 
-int
-main (void)
+int main(void)
 {
   uint32_t u32;
   uint16_t u16;
 
   u32 = htonl(0x12345678);
+  (void) u32;
   u16 = htons(0x1234);
+  (void) u16;
 
   u32 = ntohl(0x12345678);
+  (void) u32;
   u16 = ntohs(0x1234);
+  (void) u16;
   
   return 0;
 }
diff --git a/testsuites/libtests/POSIX/iconv.c b/testsuites/libtests/POSIX/iconv.c
index 7dc25ec..321f188 100644
--- a/testsuites/libtests/POSIX/iconv.c
+++ b/testsuites/libtests/POSIX/iconv.c
@@ -12,8 +12,7 @@
 
 #include <iconv.h>
 
-int
-main (void)
+int main(void)
 {
   iconv_t cd = NULL;
   char inbuf[42];
@@ -26,5 +25,5 @@ main (void)
   char *o = outbuf;
   ret = iconv(cd, &i, &isize, &o, &osize);
 
-  return 0;
+  return ret;
 }
diff --git a/testsuites/libtests/POSIX/iconv_close.c b/testsuites/libtests/POSIX/iconv_close.c
index 3a15788..422a40b 100644
--- a/testsuites/libtests/POSIX/iconv_close.c
+++ b/testsuites/libtests/POSIX/iconv_close.c
@@ -12,13 +12,12 @@
 
 #include <iconv.h>
 
-int
-main (void)
+int main(void)
 {
   iconv_t cd = NULL;
   int ret;
 
   ret = iconv_close(cd);
 
-  return 0;
+  return ret;
 }
diff --git a/testsuites/libtests/POSIX/iconv_open.c b/testsuites/libtests/POSIX/iconv_open.c
index 7fe11de..11540b5 100644
--- a/testsuites/libtests/POSIX/iconv_open.c
+++ b/testsuites/libtests/POSIX/iconv_open.c
@@ -12,12 +12,11 @@
 
 #include <iconv.h>
 
-int
-main (void)
+int main(void)
 {
   iconv_t ret;
 
   ret = iconv_open("utf8", "ascii" );
 
-  return 0;
+  return (ret == 0);
 }
diff --git a/testsuites/libtests/POSIX/issetugid.c b/testsuites/libtests/POSIX/issetugid.c
index 01ead61..d964769 100644
--- a/testsuites/libtests/POSIX/issetugid.c
+++ b/testsuites/libtests/POSIX/issetugid.c
@@ -12,11 +12,10 @@
 
 #include <unistd.h>
 
-int
-main (void)
+int main(void)
 {
   int status;
-  status = issetugid ();
+  status = issetugid();
 
-  return 0;
+  return status;
 }
diff --git a/testsuites/libtests/POSIX/kill.c b/testsuites/libtests/POSIX/kill.c
index 1ab2d77..402f90d 100644
--- a/testsuites/libtests/POSIX/kill.c
+++ b/testsuites/libtests/POSIX/kill.c
@@ -12,14 +12,18 @@
 
 #include <signal.h>
 
-int
-main (void)
+int main(void)
 {
   pid_t pid = 0;
+  int rc;
 
-  kill (pid, SIGHUP);
-  kill (pid, SIGKILL);
-  kill (pid, SIGTERM);
+  rc = kill(pid, SIGHUP);
+  (void) rc;
 
-  return 0;
+  rc = kill(pid, SIGKILL);
+  (void) rc;
+
+  rc = kill(pid, SIGTERM);
+
+  return rc;
 }
diff --git a/testsuites/libtests/POSIX/longjmp.c b/testsuites/libtests/POSIX/longjmp.c
index 68f0f83..a266020 100644
--- a/testsuites/libtests/POSIX/longjmp.c
+++ b/testsuites/libtests/POSIX/longjmp.c
@@ -12,10 +12,9 @@
 
 #include <setjmp.h>
 
-int
-main (void)
+int main(void)
 {
   jmp_buf buf;
-  longjmp (buf, 0);
+  longjmp(buf, 0);
   return 0;
 }
diff --git a/testsuites/libtests/POSIX/lseek.c b/testsuites/libtests/POSIX/lseek.c
index 169d55c..e1d6505 100644
--- a/testsuites/libtests/POSIX/lseek.c
+++ b/testsuites/libtests/POSIX/lseek.c
@@ -13,15 +13,19 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-int
-main (void)
+int main(void)
 {
   off_t res;
   int fd = 42;
 
-  res = lseek (fd, 0, SEEK_SET);
-  res = lseek (fd, 1, SEEK_CUR);
-  res = lseek (fd, 2, SEEK_END);
+  res = lseek(fd, 0, SEEK_SET);
+  (void) res;
+
+  res = lseek(fd, 1, SEEK_CUR);
+  (void) res;
+
+  res = lseek(fd, 2, SEEK_END);
+  (void) res;
 
   return 0;
 }
diff --git a/testsuites/libtests/POSIX/lstat.c b/testsuites/libtests/POSIX/lstat.c
index d92f86e..afe3fb6 100644
--- a/testsuites/libtests/POSIX/lstat.c
+++ b/testsuites/libtests/POSIX/lstat.c
@@ -14,13 +14,12 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-int
-main (void)
+int main(void)
 {
   struct stat buf;
   int status;
 
-  status = lstat ("/tmp/foo", &buf);
+  status = lstat("/tmp/foo", &buf);
 
-  return 0;
+  return status;
 }
diff --git a/testsuites/libtests/POSIX/malloc.c b/testsuites/libtests/POSIX/malloc.c
index 2f16bd3..dc9ccca 100644
--- a/testsuites/libtests/POSIX/malloc.c
+++ b/testsuites/libtests/POSIX/malloc.c
@@ -12,10 +12,9 @@
 
 #include <stdlib.h>
 
-int
-main (void)
+int main(void)
 {
-  void *ptr = malloc (42);
+  void *ptr = malloc(42);
 
   return (ptr != NULL);
 }
diff --git a/testsuites/libtests/POSIX/nanosleep.c b/testsuites/libtests/POSIX/nanosleep.c
index 359ce76..0e698f2 100644
--- a/testsuites/libtests/POSIX/nanosleep.c
+++ b/testsuites/libtests/POSIX/nanosleep.c
@@ -12,14 +12,13 @@
 
 #include <time.h>
 
-int
-main (void)
+int main(void)
 {
   struct timespec req = { 0, 42 };
   struct timespec rem;
   int status;
 
-  status = nanosleep (&req, &rem);
+  status = nanosleep(&req, &rem);
 
-  return 0;
+  return status;
 }
diff --git a/testsuites/libtests/POSIX/open.c b/testsuites/libtests/POSIX/open.c
index f7d60bb..55d6246 100644
--- a/testsuites/libtests/POSIX/open.c
+++ b/testsuites/libtests/POSIX/open.c
@@ -14,14 +14,13 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
-int
-main (void)
+int main(void)
 {
   int fd1;
   int fd2;
 
-  fd1 = open ("/tmp/foo1", O_RDWR | O_APPEND);
-  fd2 = open ("/tmp/foo2", O_CREAT, S_IWUSR);
+  fd1 = open("/tmp/foo1", O_RDWR | O_APPEND);
+  fd2 = open("/tmp/foo2", O_CREAT, S_IWUSR);
 
-  return 0;
+  return (fd1 != fd2);
 }
diff --git a/testsuites/libtests/POSIX/pipe.c b/testsuites/libtests/POSIX/pipe.c
index 85d15af..22df3be 100644
--- a/testsuites/libtests/POSIX/pipe.c
+++ b/testsuites/libtests/POSIX/pipe.c
@@ -12,13 +12,12 @@
 
 #include <unistd.h>
 
-int
-main (void)
+int main(void)
 {
   int filedes[2];
   int status;
 
-  status = pipe (filedes);
+  status = pipe(filedes);
 
-  return 0;
+  return status;
 }
diff --git a/testsuites/libtests/POSIX/posix_memalign.c b/testsuites/libtests/POSIX/posix_memalign.c
index a224100..c18852f 100644
--- a/testsuites/libtests/POSIX/posix_memalign.c
+++ b/testsuites/libtests/POSIX/posix_memalign.c
@@ -12,11 +12,10 @@
 
 #include <stdlib.h>
 
-int
-main (void)
+int main(void)
 {
   void *a;
-  int ret = posix_memalign (&a, sizeof (void *) * 2, 42);
+  int ret = posix_memalign(&a, sizeof (void *) * 2, 42);
 
   return ret;
 }
diff --git a/testsuites/libtests/POSIX/read.c b/testsuites/libtests/POSIX/read.c
index c495480..133c8f4 100644
--- a/testsuites/libtests/POSIX/read.c
+++ b/testsuites/libtests/POSIX/read.c
@@ -12,14 +12,13 @@
 
 #include <unistd.h>
 
-int
-main (void)
+int main(void)
 {
   int fd = 42;
   char buf[4];
   ssize_t len;
 
-  len = read (fd, &buf, 4);
+  len = read(fd, &buf, 4);
 
-  return 0;
+  return (len != 0);
 }
diff --git a/testsuites/libtests/POSIX/readv.c b/testsuites/libtests/POSIX/readv.c
index 12b804e..a980e94 100644
--- a/testsuites/libtests/POSIX/readv.c
+++ b/testsuites/libtests/POSIX/readv.c
@@ -12,14 +12,13 @@
 
 #include <sys/uio.h>
 
-int
-main (void)
+int main(void)
 {
   struct iovec iov;
   int count = 4;
   ssize_t ret;
 
-  ret = readv (0, &iov, count);
+  ret = readv(0, &iov, count);
 
   return ret;
 }
diff --git a/testsuites/libtests/POSIX/realloc.c b/testsuites/libtests/POSIX/realloc.c
index ac972db..2203e4b 100644
--- a/testsuites/libtests/POSIX/realloc.c
+++ b/testsuites/libtests/POSIX/realloc.c
@@ -12,10 +12,9 @@
 
 #include <stdlib.h>
 
-int
-main (void)
+int main(void)
 {
-  realloc (NULL, 42);
+  void *p = realloc(NULL, 42);
 
-  return 0;
+  return (p == NULL);
 }
diff --git a/testsuites/libtests/POSIX/setjmp.c b/testsuites/libtests/POSIX/setjmp.c
index b460c67..e0fdbad 100644
--- a/testsuites/libtests/POSIX/setjmp.c
+++ b/testsuites/libtests/POSIX/setjmp.c
@@ -12,10 +12,9 @@
 
 #include <setjmp.h>
 
-int
-main (void)
+int main(void)
 {
   jmp_buf buf;
-  setjmp (buf);
+  setjmp(buf);
   return 0;
 }
diff --git a/testsuites/libtests/POSIX/sigaddset.c b/testsuites/libtests/POSIX/sigaddset.c
index 4a01457..39c33f0 100644
--- a/testsuites/libtests/POSIX/sigaddset.c
+++ b/testsuites/libtests/POSIX/sigaddset.c
@@ -12,12 +12,11 @@
 
 #include <signal.h>
 
-int
-main (void)
+int main(void)
 {
   sigset_t set;
   int status;
-  status = sigaddset (&set, 21);
+  status = sigaddset(&set, 21);
 
   return status;
 }
diff --git a/testsuites/libtests/POSIX/sigdelset.c b/testsuites/libtests/POSIX/sigdelset.c
index 58b1bcc..6a45e66 100644
--- a/testsuites/libtests/POSIX/sigdelset.c
+++ b/testsuites/libtests/POSIX/sigdelset.c
@@ -12,12 +12,11 @@
 
 #include <signal.h>
 
-int
-main (void)
+int main(void)
 {
   sigset_t set;
   int status;
-  status = sigdelset (&set, 21);
+  status = sigdelset(&set, 21);
 
   return status;
 }
diff --git a/testsuites/libtests/POSIX/sigemptyset.c b/testsuites/libtests/POSIX/sigemptyset.c
index effda5e..5a53150 100644
--- a/testsuites/libtests/POSIX/sigemptyset.c
+++ b/testsuites/libtests/POSIX/sigemptyset.c
@@ -12,11 +12,10 @@
 
 #include <signal.h>
 
-int
-main (void)
+int main(void)
 {
   sigset_t set;
-  int status = sigemptyset (&set);
+  int status = sigemptyset(&set);
 
   return status;
 }
diff --git a/testsuites/libtests/POSIX/sigfillset.c b/testsuites/libtests/POSIX/sigfillset.c
index 521c85f..23801bc 100644
--- a/testsuites/libtests/POSIX/sigfillset.c
+++ b/testsuites/libtests/POSIX/sigfillset.c
@@ -12,12 +12,11 @@
 
 #include <signal.h>
 
-int
-main (void)
+int main(void)
 {
   sigset_t set;
   int status;
-  status = sigfillset (&set);
+  status = sigfillset(&set);
 
   return status;
 }
diff --git a/testsuites/libtests/POSIX/sigismember.c b/testsuites/libtests/POSIX/sigismember.c
index 92ff877..ed980b7 100644
--- a/testsuites/libtests/POSIX/sigismember.c
+++ b/testsuites/libtests/POSIX/sigismember.c
@@ -12,8 +12,7 @@
 
 #include <signal.h>
 
-int
-main (void)
+int main(void)
 {
   sigset_t set;
   int status;
diff --git a/testsuites/libtests/POSIX/sigprocmask.c b/testsuites/libtests/POSIX/sigprocmask.c
index 6fc37b3..ba634e4 100644
--- a/testsuites/libtests/POSIX/sigprocmask.c
+++ b/testsuites/libtests/POSIX/sigprocmask.c
@@ -12,15 +12,18 @@
 
 #include <signal.h>
 
-int
-main (void)
+int main(void)
 {
-  int status;
+  int rc;
   sigset_t set1, set2;
 
-  status = sigprocmask (SIG_BLOCK, &set1, &set2);
-  status = sigprocmask (SIG_UNBLOCK, &set1, &set2);
-  status = sigprocmask (SIG_SETMASK, &set1, &set2);
+  rc = sigprocmask(SIG_BLOCK, &set1, &set2);
+  (void) rc;
 
-  return 0;
+  rc = sigprocmask(SIG_UNBLOCK, &set1, &set2);
+  (void) rc;
+
+  rc = sigprocmask(SIG_SETMASK, &set1, &set2);
+
+  return rc;
 }
diff --git a/testsuites/libtests/POSIX/stat.c b/testsuites/libtests/POSIX/stat.c
index 889eb4d..63d0171 100644
--- a/testsuites/libtests/POSIX/stat.c
+++ b/testsuites/libtests/POSIX/stat.c
@@ -14,13 +14,12 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-int
-main (void)
+int main(void)
 {
   struct stat buf;
   int status;
 
-  status = stat ("/tmp/foo", &buf);
+  status = stat("/tmp/foo", &buf);
 
-  return 0;
+  return status;
 }
diff --git a/testsuites/libtests/POSIX/unlink.c b/testsuites/libtests/POSIX/unlink.c
index 25ed5cc..dc8a370 100644
--- a/testsuites/libtests/POSIX/unlink.c
+++ b/testsuites/libtests/POSIX/unlink.c
@@ -16,7 +16,7 @@ int
 main (void)
 {
   int status;
-  status = unlink ("/tmp/foo");
+  status = unlink("/tmp/foo");
 
-  return 0;
+  return status;
 }
diff --git a/testsuites/libtests/POSIX/vfork.c b/testsuites/libtests/POSIX/vfork.c
index 7868ae6..7e5858a 100644
--- a/testsuites/libtests/POSIX/vfork.c
+++ b/testsuites/libtests/POSIX/vfork.c
@@ -13,11 +13,10 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-int
-main (void)
+int main(void)
 {
   pid_t pid;
-  pid = vfork ();
+  pid = vfork();
 
-  return 0;
+  return (pid != 0);
 }
diff --git a/testsuites/libtests/POSIX/wait.c b/testsuites/libtests/POSIX/wait.c
index 9069bdb..e1f1dc1 100644
--- a/testsuites/libtests/POSIX/wait.c
+++ b/testsuites/libtests/POSIX/wait.c
@@ -13,12 +13,11 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 
-int
-main (void)
+int main(void)
 {
   int status;
   pid_t pid;
   pid = wait(&status);
 
-  return 0;
+  return (pid != 0);
 }
diff --git a/testsuites/libtests/POSIX/waitpid.c b/testsuites/libtests/POSIX/waitpid.c
index 991d27a..0164c43 100644
--- a/testsuites/libtests/POSIX/waitpid.c
+++ b/testsuites/libtests/POSIX/waitpid.c
@@ -14,11 +14,11 @@
 #include <sys/wait.h>
 
 int
-main (void)
+main(void)
 {
   int status;
   pid_t pid;
-  pid = waitpid (-1, &status, WNOHANG);
+  pid = waitpid(-1, &status, WNOHANG);
 
-  return 0;
+  return (pid != 0);
 }
diff --git a/testsuites/libtests/POSIX/write.c b/testsuites/libtests/POSIX/write.c
index 211e7d3..23c1f85 100644
--- a/testsuites/libtests/POSIX/write.c
+++ b/testsuites/libtests/POSIX/write.c
@@ -12,14 +12,13 @@
 
 #include <unistd.h>
 
-int
-main (void)
+int main(void)
 {
   char string[] = "1234";
   size_t count = 4;
   ssize_t ret;
 
-  ret = write (0, &string, count);
+  ret = write(0, &string, count);
 
-  return 0;
+  return ret;
 }
diff --git a/testsuites/libtests/POSIX/writev.c b/testsuites/libtests/POSIX/writev.c
index b0312d4..853b8a8 100644
--- a/testsuites/libtests/POSIX/writev.c
+++ b/testsuites/libtests/POSIX/writev.c
@@ -12,14 +12,13 @@
 
 #include <sys/uio.h>
 
-int
-main (void)
+int main(void)
 {
   struct iovec iov;
   int count = 4;
   ssize_t ret;
 
-  ret = writev (0, &iov, count);
+  ret = writev(0, &iov, count);
 
   return ret;
 }
-- 
1.8.3.1




More information about the devel mailing list