* libltp/include/test.h: Fix C warnings.
* winsup.api/checksignal.c: Ditto. * winsup.api/crlf.c: Ditto. * winsup.api/devzero.c: Ditto. * winsup.api/iospeed.c: Ditto. * winsup.api/mmaptest01.c: Ditto. * winsup.api/mmaptest02.c: Ditto. * winsup.api/mmaptest03.c: Ditto. * winsup.api/mmaptest04.c: Ditto. * winsup.api/nullgetcwd.c: Ditto. * winsup.api/sigchld.c: Ditto. * winsup.api/signal-into-win32-api.c: Ditto. * winsup.api/systemcall.c: Ditto. * winsup.api/waitpid.c: Ditto. * winsup.api/pthread/mainthreadexits.c: Ditto. * winsup.api/pthread/test.h: Ditto. * winsup.api/pthread/threadidafterfork.c: Ditto. * Makefile.in: Remove cygrun.exe from RUNTIME since it is built here now.
This commit is contained in:
parent
d8f0f146b8
commit
9b978ffe8b
@ -1,3 +1,26 @@
|
|||||||
|
2003-01-23 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
|
* libltp/include/test.h: Fix C warnings.
|
||||||
|
* winsup.api/checksignal.c: Ditto.
|
||||||
|
* winsup.api/crlf.c: Ditto.
|
||||||
|
* winsup.api/devzero.c: Ditto.
|
||||||
|
* winsup.api/iospeed.c: Ditto.
|
||||||
|
* winsup.api/mmaptest01.c: Ditto.
|
||||||
|
* winsup.api/mmaptest02.c: Ditto.
|
||||||
|
* winsup.api/mmaptest03.c: Ditto.
|
||||||
|
* winsup.api/mmaptest04.c: Ditto.
|
||||||
|
* winsup.api/nullgetcwd.c: Ditto.
|
||||||
|
* winsup.api/sigchld.c: Ditto.
|
||||||
|
* winsup.api/signal-into-win32-api.c: Ditto.
|
||||||
|
* winsup.api/systemcall.c: Ditto.
|
||||||
|
* winsup.api/waitpid.c: Ditto.
|
||||||
|
* winsup.api/pthread/mainthreadexits.c: Ditto.
|
||||||
|
* winsup.api/pthread/test.h: Ditto.
|
||||||
|
* winsup.api/pthread/threadidafterfork.c: Ditto.
|
||||||
|
|
||||||
|
* Makefile.in: Remove cygrun.exe from RUNTIME since it is built here
|
||||||
|
now.
|
||||||
|
|
||||||
2003-01-23 Christopher Faylor <cgf@redhat.com>
|
2003-01-23 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* Makeifle.in: Use ALL_CFLAGS to build test programs so that correct
|
* Makeifle.in: Use ALL_CFLAGS to build test programs so that correct
|
||||||
|
@ -88,7 +88,7 @@ ifdef VERBOSE
|
|||||||
RUNTESTFLAGS = -v
|
RUNTESTFLAGS = -v
|
||||||
endif
|
endif
|
||||||
|
|
||||||
RUNTIME=$(cygwin_build)/new-cygwin1.dll $(cygwin_build)/new-libcygwin.a cygrun.exe
|
RUNTIME=$(cygwin_build)/new-cygwin1.dll $(cygwin_build)/new-libcygwin.a
|
||||||
|
|
||||||
TESTSUP_LIB_NAME:=libltp.a
|
TESTSUP_LIB_NAME:=libltp.a
|
||||||
TESTSUP_OFILES:=${sort ${addsuffix .o,${basename ${notdir ${wildcard $(libltp_srcdir)/lib/*.c}}}}}
|
TESTSUP_OFILES:=${sort ${addsuffix .o,${basename ${notdir ${wildcard $(libltp_srcdir)/lib/*.c}}}}}
|
||||||
@ -187,4 +187,3 @@ cygrun.o: cygrun.c
|
|||||||
|
|
||||||
cygrun.exe : cygrun.o
|
cygrun.exe : cygrun.o
|
||||||
$(CC) ${MINGW_LDFLAGS} -mno-cygwin -o $@ $<
|
$(CC) ${MINGW_LDFLAGS} -mno-cygwin -o $@ $<
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ extern void tst_brkm(int ttype, void (*func)(), const char *arg_fmt, ...);
|
|||||||
extern void tst_brkloopm(int ttype, void (*func)(), const char *arg_fmt, ...);
|
extern void tst_brkloopm(int ttype, void (*func)(), const char *arg_fmt, ...);
|
||||||
|
|
||||||
extern int tst_environ();
|
extern int tst_environ();
|
||||||
extern void tst_exit();
|
extern void tst_exit() __attribute__ ((noreturn));
|
||||||
extern void tst_flush();
|
extern void tst_flush();
|
||||||
|
|
||||||
/* prototypes for the t_res.c functions */
|
/* prototypes for the t_res.c functions */
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "test.h"
|
#include "test.h"
|
||||||
#include "usctest.h"
|
#include "usctest.h"
|
||||||
|
|
||||||
char *TCID = "checksignal"; /* Test program identifier. */
|
const char *TCID = "checksignal"; /* Test program identifier. */
|
||||||
int TST_TOTAL = 3; /* Total number of test cases. */
|
int TST_TOTAL = 3; /* Total number of test cases. */
|
||||||
extern int Tst_count; /* Test Case counter for tst_* routines */
|
extern int Tst_count; /* Test Case counter for tst_* routines */
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
Nop=100000, /* ; do nothing */
|
Nop=100000, /* ; do nothing */
|
||||||
New1, /* ; reset and begin new test */
|
New1, /* ; reset and begin new test */
|
||||||
@ -146,6 +145,7 @@ int commands[] = {
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#ifndef O_BINARY
|
#ifndef O_BINARY
|
||||||
#define O_BINARY 0
|
#define O_BINARY 0
|
||||||
@ -250,7 +250,7 @@ v(char *fmt, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
vp(char *fmt, ...)
|
vp(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
if (!verbose) return;
|
if (!verbose) return;
|
||||||
@ -262,7 +262,7 @@ vp(char *fmt, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
errorq(int use_errno, char *fmt, ...)
|
errorq(int use_errno, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
fprintf(stderr, "crlf: Error at pc=%d: ", pc);
|
fprintf(stderr, "crlf: Error at pc=%d: ", pc);
|
||||||
@ -276,7 +276,7 @@ errorq(int use_errno, char *fmt, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
error(int use_errno, char *fmt, ...)
|
error(int use_errno, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
fprintf(stderr, "crlf: Error at pc=%d: ", pc);
|
fprintf(stderr, "crlf: Error at pc=%d: ", pc);
|
||||||
@ -291,7 +291,7 @@ error(int use_errno, char *fmt, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
display_buf(char *which, Buffer *buf, int ofs)
|
display_buf(const char *which, Buffer *buf, int ofs)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
fprintf(stderr, "%s %04x:", which, ofs);
|
fprintf(stderr, "%s %04x:", which, ofs);
|
||||||
@ -303,13 +303,13 @@ display_buf(char *which, Buffer *buf, int ofs)
|
|||||||
if (isgraph(b))
|
if (isgraph(b))
|
||||||
fprintf(stderr, " %c ", b);
|
fprintf(stderr, " %c ", b);
|
||||||
else
|
else
|
||||||
fprintf(stderr, " ", b);
|
fprintf(stderr, " . "/*, b*/);
|
||||||
}
|
}
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
compare_bufs(char *name, Buffer *actual, Buffer *expected)
|
compare_bufs(const char *name, Buffer *actual, Buffer *expected)
|
||||||
{
|
{
|
||||||
int i, got_one=0;
|
int i, got_one=0;
|
||||||
for (i=0; i<actual->count && i<expected->count; i++)
|
for (i=0; i<actual->count && i<expected->count; i++)
|
||||||
@ -340,12 +340,12 @@ compare_bufs(char *name, Buffer *actual, Buffer *expected)
|
|||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
char *readmode = "rb";
|
const char *readmode = "rb";
|
||||||
char *writemode = "wb";
|
const char *writemode = "wb";
|
||||||
FILE *file = 0;
|
FILE *file = 0;
|
||||||
int i, fd;
|
int i;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
char *str;
|
const char *str = "";
|
||||||
|
|
||||||
while (argc > 1 && argv[1][0] == '-')
|
while (argc > 1 && argv[1][0] == '-')
|
||||||
{
|
{
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
|
||||||
main()
|
int
|
||||||
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int fd, r, w, l;
|
int fd, r, l;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
char *v;
|
char *v;
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ void
|
|||||||
end()
|
end()
|
||||||
{
|
{
|
||||||
unsigned long end_tic = GetTickCount();
|
unsigned long end_tic = GetTickCount();
|
||||||
printf("%6d", end_tic - start_tic);
|
printf("%6ld", end_tic - start_tic);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -52,11 +52,12 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
#include "usctest.h"
|
#include "usctest.h"
|
||||||
|
|
||||||
char *TCID = "mmaptest01"; /* Test program identifier. */
|
const char *TCID = "mmaptest01"; /* Test program identifier. */
|
||||||
int TST_TOTAL = 7; /* Total number of test cases. */
|
int TST_TOTAL = 7; /* Total number of test cases. */
|
||||||
extern int Tst_count; /* Test Case counter for tst_* routines */
|
extern int Tst_count; /* Test Case counter for tst_* routines */
|
||||||
|
|
||||||
@ -77,8 +78,6 @@ char const line2 [] = "y2 y2 y2 y2 y2 y2 y2 y2 y2 y2 y2 y2 y2 y2 y2 y2 y2\n";
|
|||||||
|
|
||||||
int main ()
|
int main ()
|
||||||
{
|
{
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
char fnam1[32];
|
char fnam1[32];
|
||||||
char fnam2[32];
|
char fnam2[32];
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
sigset_t unblock_sigsegv;
|
sigset_t unblock_sigsegv;
|
||||||
jmp_buf r;
|
jmp_buf r;
|
||||||
@ -27,7 +28,7 @@ int fd;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
perror_exit (char *str, int code)
|
perror_exit (const char *str, int code)
|
||||||
{
|
{
|
||||||
printf ("%s: %s\n", str, strerror (errno));
|
printf ("%s: %s\n", str, strerror (errno));
|
||||||
exit (code);
|
exit (code);
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
/* - Checks if mapping of already closed file survives fork()
|
/* - Checks if mapping of already closed file survives fork()
|
||||||
- Checks if mapping the same region of the same file twice
|
- Checks if mapping the same region of the same file twice
|
||||||
@ -21,7 +22,7 @@ jmp_buf r;
|
|||||||
char const line[] = "y1 y1 y1 y1 y1 y1 y1 y1 y1 y1 y1 y1 y1 y1 y1 y1 y1";
|
char const line[] = "y1 y1 y1 y1 y1 y1 y1 y1 y1 y1 y1 y1 y1 y1 y1 y1 y1";
|
||||||
|
|
||||||
void
|
void
|
||||||
perror_exit (char *str)
|
perror_exit (const char *str)
|
||||||
{
|
{
|
||||||
printf ("%s: %s\n", str, strerror (errno));
|
printf ("%s: %s\n", str, strerror (errno));
|
||||||
exit (1);
|
exit (1);
|
||||||
@ -37,7 +38,7 @@ sigsegv (int unused)
|
|||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i, fd, status;
|
int fd, status;
|
||||||
struct stat statbuf;
|
struct stat statbuf;
|
||||||
char c, *buf1, *buf2;
|
char c, *buf1, *buf2;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#ifndef O_BINARY
|
#ifndef O_BINARY
|
||||||
#define O_BINARY 0
|
#define O_BINARY 0
|
||||||
@ -10,7 +13,7 @@
|
|||||||
int
|
int
|
||||||
main ()
|
main ()
|
||||||
{
|
{
|
||||||
char *data, *data2, *data3;
|
char *data, *data2 = NULL, *data3;
|
||||||
int i, pagesize;
|
int i, pagesize;
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <stdlib.h>
|
||||||
int
|
int
|
||||||
main (int argc, char *argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
char *cwd = getcwd (NULL, 256);
|
char *cwd = getcwd (NULL, 256);
|
||||||
if (cwd == NULL)
|
if (cwd == NULL)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
static void * Thread (void *);
|
static void * Thread (void *);
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
/* #define assert(x) do { fprint (stderr, "assertion failed\n"); exit(1) } while (0) */
|
/* #define assert(x) do { fprint (stderr, "assertion failed\n"); exit(1) } while (0) */
|
||||||
|
|
||||||
char * error_string[] = {
|
const char * error_string[] = {
|
||||||
"ZERO_or_EOK",
|
"ZERO_or_EOK",
|
||||||
"EPERM",
|
"EPERM",
|
||||||
"ENOFILE_or_ENOENT",
|
"ENOFILE_or_ENOENT",
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
static void * TestThread ( void * );
|
static void * TestThread ( void * );
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
int no_signal_caught = 1;
|
int no_signal_caught = 1;
|
||||||
|
|
||||||
@ -9,6 +10,7 @@ void handler ( int signo )
|
|||||||
no_signal_caught = 0;
|
no_signal_caught = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
@ -54,4 +54,5 @@ main (int argc, char** argv)
|
|||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
exit (0);
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
@ -13,19 +16,19 @@ main (int argc, char **argv)
|
|||||||
close (0);
|
close (0);
|
||||||
if ((fd = open ("/dev/null", O_WRONLY)) != 0)
|
if ((fd = open ("/dev/null", O_WRONLY)) != 0)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "couldn't redirect stdin to /dev/null, fd %d - %s\n", fd, strerror ());
|
fprintf (stderr, "couldn't redirect stdin to /dev/null, fd %d - %s\n", fd, strerror (errno));
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
close (1);
|
close (1);
|
||||||
if ((fd = open ("/dev/null", O_WRONLY)) != 1)
|
if ((fd = open ("/dev/null", O_WRONLY)) != 1)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "couldn't redirect stdout to /dev/null, fd %d - %s\n", fd, strerror ());
|
fprintf (stderr, "couldn't redirect stdout to /dev/null, fd %d - %s\n", fd, strerror (errno));
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
if (pipe (fds))
|
if (pipe (fds))
|
||||||
{
|
{
|
||||||
fprintf (stderr, "pipe call failed - %s\n", strerror ());
|
fprintf (stderr, "pipe call failed - %s\n", strerror (errno));
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
if ((pid = fork ()) == 0)
|
if ((pid = fork ()) == 0)
|
||||||
@ -33,7 +36,7 @@ main (int argc, char **argv)
|
|||||||
close (fds[0]);
|
close (fds[0]);
|
||||||
if (dup2 (fds[1], 2) != 2)
|
if (dup2 (fds[1], 2) != 2)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "couldn't redirect stderr to pipe - %s\n", strerror ());
|
fprintf (stderr, "couldn't redirect stderr to pipe - %s\n", strerror (errno));
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
exit (system ("ls"));
|
exit (system ("ls"));
|
||||||
@ -58,7 +61,7 @@ main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
if (n != 0)
|
if (n != 0)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "system() call returned %p\n", n);
|
fprintf (stderr, "system() call returned %p\n", (void *) n);
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
exit (0);
|
exit (0);
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user