Commit a5228b3b authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

Merge branch 'zdtm' of https://github.com/avagin/crtools

* 'zdtm' of https://github.com/avagin/crtools:
  zdtm: remove warnings
  zdtm: move tast_daemon after preparation actions
  zdtm: fix warnings in mmx00.c
  zdtm: say no to EINTR
  zdtm: fix warning in Makefile
  zdtm: fix warning in transition/ptrace.c
  zdtm: initilize a variable in cmdlinenv00.c
parents 255cd497 61f50a9c
CFLAGS = -g -O2 -Wall
CFLAGS = -g -O2 -Wall -Werror
LIB = libzdtmtst.a
......
......@@ -27,7 +27,7 @@ void test_msg(const char *format, ...)
va_end(arg);
if (len >= msg_buf.left) { /* indicate message buffer overflow */
const static char overflow_mark[] = "\n.@.\n";
const char overflow_mark[] = "\n.@.\n";
msg_buf.left = 0;
msg_buf.ptr = msg_buf.buffer + sizeof(msg_buf.buffer);
strcpy(msg_buf.ptr - sizeof(overflow_mark), overflow_mark);
......@@ -56,7 +56,6 @@ void dump_msg(const char *fname)
return;
/* ignore errors as there's no way to report them */
write(fd, msg_buf.buffer, msg_buf.ptr - msg_buf.buffer);
out:
close(fd);
}
}
#define _GNU_SOURCE
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
......@@ -8,6 +9,7 @@
#include <sys/wait.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sched.h>
#include "zdtmtst.h"
......@@ -83,6 +85,7 @@ void test_init(int argc, char **argv)
static FILE *pidf;
struct sigaction sa = {
.sa_handler = sig_hand,
.sa_flags = SA_RESTART,
};
sigemptyset(&sa.sa_mask);
......@@ -157,7 +160,7 @@ void test_init(int argc, char **argv)
#define STACK_SIZE (8 * 4096)
struct zdtm_clone_arg {
int pidf;
FILE *pidf;
void (*fn)(void);
};
......
LIBDIR = ../../lib
LIB = $(LIBDIR)/libzdtmtst.a
override CPPFLAGS += -I$(LIBDIR)
CFLAGS = -g -O2 -Wall
CFLAGS = -g -O2 -Wall -Werror
TST_NOFILE = \
busyloop00 \
......@@ -27,7 +27,6 @@ TST_NOFILE = \
pipe00 \
pthread00 \
vdso00 \
cmdlinenv00 \
utsname \
# jobctl00 \
......@@ -64,6 +63,7 @@ TST = \
$(TST_DIR) \
env00 \
umask00 \
cmdlinenv00 \
TST_STATE = \
conntracks \
......
......@@ -21,7 +21,7 @@ TEST_OPTION(arg3, string, "arg3", 1);
static void read_from_proc(const char *path, char *buf, size_t size)
{
size_t r, ret;
size_t r = 0, ret;
int fd;
fd = open(path, O_RDONLY);
......
......@@ -19,7 +19,7 @@ void start(uint8_t *bytes, uint16_t *words)
"psubw %%mm2, %%mm3\n"
:
: "m" (bytes[0]), "m" (bytes[8]),
"m" (words[0]), "m" (words[8])
"m" (words[0]), "m" (words[4])
);
}
......
......@@ -33,7 +33,7 @@ int main(int argc, char **argv)
int fd, fd_s;
int status;
pid_t pid;
int ret, res;
int res;
uint32_t crc;
test_init(argc, argv);
......
LIBDIR = ../../lib
LIB = $(LIBDIR)/libzdtmtst.a
override CPPFLAGS += -I$(LIBDIR)
CFLAGS = -g -O2 -Wall
CFLAGS = -g -O2 -Wall -Werror
TST_NOFILE = \
pipe_loop00 \
......
......@@ -68,11 +68,9 @@ cmd_t cmd[CMD_NUM]={form_request_add, form_request_del};
int main(int argc, char *argv[])
{
int ret=0;
int i;
test_init(argc, argv);
test_daemon();
fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
if (fd<0){
......@@ -86,7 +84,6 @@ int main(int argc, char *argv[])
la.nl_pid = getpid();
if (bind(fd, (struct sockaddr*) &la, sizeof(la))){
err("bind failed: %m ");
ret=-1;
goto out;
}
//Preperation:
......@@ -94,6 +91,8 @@ int main(int argc, char *argv[])
send_request();
recv_reply();
test_daemon();
while (test_go()){
for (i=0;i<CMD_NUM;i++){
cmd[i]();
......
LIBDIR = ../../lib
LIB = $(LIBDIR)/libzdtmtst.a
override CPPFLAGS += -I$(LIBDIR)
CFLAGS = -g -O2 -Wall
CFLAGS = -g -O2 -Wall -Werror
TST_NOFILE = \
file_read \
......
......@@ -59,7 +59,7 @@ static void run_child(int num)
int fd = fds[num][1];
uint32_t crc = ~0;
size_t buf_size=512;
char buf[buf_size];
uint8_t buf[buf_size];
struct timeval tv;
struct timespec ts;
int rv;
......
......@@ -25,6 +25,7 @@ static void *thread(void *arg)
*(int *)arg = syscall(SYS_gettid);
while (1)
sleep(1);
return NULL;
}
int main(int argc, char **argv)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment