summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel@rtems.org>2018-08-10 08:23:01 -0500
committerJoel Sherrill <joel@rtems.org>2018-08-10 08:24:29 -0500
commit382d6537df61d1783985e395b4418324cad1f324 (patch)
treead927aea2ce673f47e6098a1e91194550c56b91c
parentbsps/sparc/include/bsp/gradcdac.h: Fix nested comment warning (diff)
downloadrtems-382d6537df61d1783985e395b4418324cad1f324.tar.bz2
libtests/POSIX: Fix warnings and style.
-rw-r--r--testsuites/libtests/POSIX/close.c4
-rw-r--r--testsuites/libtests/POSIX/dup2.c4
-rw-r--r--testsuites/libtests/POSIX/fcntl.c13
-rw-r--r--testsuites/libtests/POSIX/flockfile.c1
-rw-r--r--testsuites/libtests/POSIX/fork.c6
-rw-r--r--testsuites/libtests/POSIX/free.c5
-rw-r--r--testsuites/libtests/POSIX/fstat.c9
-rw-r--r--testsuites/libtests/POSIX/ftrylockfile.c4
-rw-r--r--testsuites/libtests/POSIX/funlockfile.c1
-rw-r--r--testsuites/libtests/POSIX/getdents.c6
-rw-r--r--testsuites/libtests/POSIX/getlogin.c5
-rw-r--r--testsuites/libtests/POSIX/getpwnam.c8
-rw-r--r--testsuites/libtests/POSIX/getpwuid.c3
-rw-r--r--testsuites/libtests/POSIX/gettimeofday.c3
-rw-r--r--testsuites/libtests/POSIX/getuid.c7
-rw-r--r--testsuites/libtests/POSIX/htonl.c7
-rw-r--r--testsuites/libtests/POSIX/iconv.c5
-rw-r--r--testsuites/libtests/POSIX/iconv_close.c5
-rw-r--r--testsuites/libtests/POSIX/iconv_open.c5
-rw-r--r--testsuites/libtests/POSIX/issetugid.c7
-rw-r--r--testsuites/libtests/POSIX/kill.c16
-rw-r--r--testsuites/libtests/POSIX/longjmp.c5
-rw-r--r--testsuites/libtests/POSIX/lseek.c14
-rw-r--r--testsuites/libtests/POSIX/lstat.c7
-rw-r--r--testsuites/libtests/POSIX/malloc.c5
-rw-r--r--testsuites/libtests/POSIX/nanosleep.c7
-rw-r--r--testsuites/libtests/POSIX/open.c9
-rw-r--r--testsuites/libtests/POSIX/pipe.c7
-rw-r--r--testsuites/libtests/POSIX/posix_memalign.c5
-rw-r--r--testsuites/libtests/POSIX/read.c7
-rw-r--r--testsuites/libtests/POSIX/readv.c5
-rw-r--r--testsuites/libtests/POSIX/realloc.c7
-rw-r--r--testsuites/libtests/POSIX/setjmp.c5
-rw-r--r--testsuites/libtests/POSIX/sigaddset.c5
-rw-r--r--testsuites/libtests/POSIX/sigdelset.c5
-rw-r--r--testsuites/libtests/POSIX/sigemptyset.c5
-rw-r--r--testsuites/libtests/POSIX/sigfillset.c5
-rw-r--r--testsuites/libtests/POSIX/sigismember.c3
-rw-r--r--testsuites/libtests/POSIX/sigprocmask.c17
-rw-r--r--testsuites/libtests/POSIX/stat.c7
-rw-r--r--testsuites/libtests/POSIX/unlink.c4
-rw-r--r--testsuites/libtests/POSIX/vfork.c7
-rw-r--r--testsuites/libtests/POSIX/wait.c5
-rw-r--r--testsuites/libtests/POSIX/waitpid.c6
-rw-r--r--testsuites/libtests/POSIX/write.c7
-rw-r--r--testsuites/libtests/POSIX/writev.c5
46 files changed, 140 insertions, 148 deletions
diff --git a/testsuites/libtests/POSIX/close.c b/testsuites/libtests/POSIX/close.c
index 5468adc160..b770a76aed 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 b090d63432..2e5238e8aa 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 dc59d5db3c..9578df418c 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 4d1f23ee34..01e322c2c9 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 d4392be4e0..e6e233fc12 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 8473084fb1..8550eaa85c 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 29c38d6eae..2798365dfd 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 8e99406493..2a724e6e30 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 571b9e8b80..0069e07f63 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 bb731e9862..fd801c714d 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 f5f38a7ad2..1655056a2c 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 c220871de4..8151dd0d2f 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 fb4d050d2a..d0ec315a90 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 f3fa6736ef..8ed8283f19 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 d4b942c58d..490a9c7ead 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 ecdaa9c05e..9ebc768066 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 7dc25eca83..321f1881f4 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 3a15788c7d..422a40b68b 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 7fe11de9ea..11540b584c 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 01ead61a5f..d964769f4f 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 1ab2d77b0a..402f90d8fb 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 68f0f83816..a266020b52 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 169d55c1c6..e1d6505098 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 d92f86e342..afe3fb6970 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 2f16bd3472..dc9ccca225 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 359ce76d58..0e698f248f 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 f7d60bb237..55d624660c 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 85d15af147..22df3be865 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 a224100f3e..c18852f6f2 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 c495480a40..133c8f4498 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 12b804e275..a980e9468c 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 ac972dbc46..2203e4b880 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 b460c6796d..e0fdbad109 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 4a01457f40..39c33f001a 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 58b1bcc292..6a45e66188 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 effda5e826..5a531504ba 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 521c85f08d..23801bc27c 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 92ff877120..ed980b70f0 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 6fc37b379d..ba634e4660 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 889eb4d620..63d0171ccd 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 25ed5cc499..dc8a370427 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 7868ae686a..7e5858a5eb 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 9069bdbe2d..e1f1dc1619 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 991d27a8ed..0164c43442 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 211e7d3b84..23c1f85091 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 b0312d42c7..853b8a8ced 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;
}