Commit 61f50a9c authored by Andrey Vagin's avatar Andrey Vagin

zdtm: remove warnings

parent 003b6e90
CFLAGS = -g -O2 -Wall CFLAGS = -g -O2 -Wall -Werror
LIB = libzdtmtst.a LIB = libzdtmtst.a
......
...@@ -27,7 +27,7 @@ void test_msg(const char *format, ...) ...@@ -27,7 +27,7 @@ void test_msg(const char *format, ...)
va_end(arg); va_end(arg);
if (len >= msg_buf.left) { /* indicate message buffer overflow */ 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.left = 0;
msg_buf.ptr = msg_buf.buffer + sizeof(msg_buf.buffer); msg_buf.ptr = msg_buf.buffer + sizeof(msg_buf.buffer);
strcpy(msg_buf.ptr - sizeof(overflow_mark), overflow_mark); strcpy(msg_buf.ptr - sizeof(overflow_mark), overflow_mark);
...@@ -56,7 +56,6 @@ void dump_msg(const char *fname) ...@@ -56,7 +56,6 @@ void dump_msg(const char *fname)
return; return;
/* ignore errors as there's no way to report them */ /* ignore errors as there's no way to report them */
write(fd, msg_buf.buffer, msg_buf.ptr - msg_buf.buffer); write(fd, msg_buf.buffer, msg_buf.ptr - msg_buf.buffer);
out:
close(fd); close(fd);
} }
} }
#define _GNU_SOURCE
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
...@@ -8,6 +9,7 @@ ...@@ -8,6 +9,7 @@
#include <sys/wait.h> #include <sys/wait.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <sched.h>
#include "zdtmtst.h" #include "zdtmtst.h"
...@@ -158,7 +160,7 @@ void test_init(int argc, char **argv) ...@@ -158,7 +160,7 @@ void test_init(int argc, char **argv)
#define STACK_SIZE (8 * 4096) #define STACK_SIZE (8 * 4096)
struct zdtm_clone_arg { struct zdtm_clone_arg {
int pidf; FILE *pidf;
void (*fn)(void); void (*fn)(void);
}; };
......
LIBDIR = ../../lib LIBDIR = ../../lib
LIB = $(LIBDIR)/libzdtmtst.a LIB = $(LIBDIR)/libzdtmtst.a
override CPPFLAGS += -I$(LIBDIR) override CPPFLAGS += -I$(LIBDIR)
CFLAGS = -g -O2 -Wall CFLAGS = -g -O2 -Wall -Werror
TST_NOFILE = \ TST_NOFILE = \
busyloop00 \ busyloop00 \
......
...@@ -33,7 +33,7 @@ int main(int argc, char **argv) ...@@ -33,7 +33,7 @@ int main(int argc, char **argv)
int fd, fd_s; int fd, fd_s;
int status; int status;
pid_t pid; pid_t pid;
int ret, res; int res;
uint32_t crc; uint32_t crc;
test_init(argc, argv); test_init(argc, argv);
......
LIBDIR = ../../lib LIBDIR = ../../lib
LIB = $(LIBDIR)/libzdtmtst.a LIB = $(LIBDIR)/libzdtmtst.a
override CPPFLAGS += -I$(LIBDIR) override CPPFLAGS += -I$(LIBDIR)
CFLAGS = -g -O2 -Wall CFLAGS = -g -O2 -Wall -Werror
TST_NOFILE = \ TST_NOFILE = \
pipe_loop00 \ pipe_loop00 \
......
...@@ -68,7 +68,6 @@ cmd_t cmd[CMD_NUM]={form_request_add, form_request_del}; ...@@ -68,7 +68,6 @@ cmd_t cmd[CMD_NUM]={form_request_add, form_request_del};
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
int ret=0;
int i; int i;
test_init(argc, argv); test_init(argc, argv);
...@@ -85,7 +84,6 @@ int main(int argc, char *argv[]) ...@@ -85,7 +84,6 @@ int main(int argc, char *argv[])
la.nl_pid = getpid(); la.nl_pid = getpid();
if (bind(fd, (struct sockaddr*) &la, sizeof(la))){ if (bind(fd, (struct sockaddr*) &la, sizeof(la))){
err("bind failed: %m "); err("bind failed: %m ");
ret=-1;
goto out; goto out;
} }
//Preperation: //Preperation:
......
LIBDIR = ../../lib LIBDIR = ../../lib
LIB = $(LIBDIR)/libzdtmtst.a LIB = $(LIBDIR)/libzdtmtst.a
override CPPFLAGS += -I$(LIBDIR) override CPPFLAGS += -I$(LIBDIR)
CFLAGS = -g -O2 -Wall CFLAGS = -g -O2 -Wall -Werror
TST_NOFILE = \ TST_NOFILE = \
file_read \ file_read \
......
...@@ -59,7 +59,7 @@ static void run_child(int num) ...@@ -59,7 +59,7 @@ static void run_child(int num)
int fd = fds[num][1]; int fd = fds[num][1];
uint32_t crc = ~0; uint32_t crc = ~0;
size_t buf_size=512; size_t buf_size=512;
char buf[buf_size]; uint8_t buf[buf_size];
struct timeval tv; struct timeval tv;
struct timespec ts; struct timespec ts;
int rv; int rv;
......
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