Skip to content

Commit

Permalink
update ct
Browse files Browse the repository at this point in the history
  • Loading branch information
kr committed Sep 14, 2012
1 parent d67d2b3 commit da3754d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions ct/ct.c
Expand Up @@ -10,6 +10,7 @@
#include <sys/wait.h>
#include <errno.h>
#include "internal.h"
#include "ct.h"


void
Expand Down Expand Up @@ -105,11 +106,11 @@ run(T t[])
static void
copyfd(FILE *out, int in)
{
int n;
ssize_t n;
char buf[1024]; // arbitrary size

while ((n = read(in, buf, sizeof(buf))) != 0) {
if (fwrite(buf, 1, n, out) != n) {
if (fwrite(buf, 1, n, out) != (size_t)n) {
die(3, errno, "fwrite");
}
}
Expand Down Expand Up @@ -157,7 +158,7 @@ report(T t[])


int
main(int argc, char *argv[])
main()
{
run(ctmain);
return report(ctmain);
Expand Down
2 changes: 1 addition & 1 deletion ct/ct.h
@@ -1,5 +1,5 @@
void ctfail(void);
void ctlogpn(char*, int, char*, ...);
void ctlogpn(char*, int, char*, ...) __attribute__((format(printf, 3, 4)));
#define ctlog(...) ctlogpn(__FILE__, __LINE__, __VA_ARGS__)
#define assert(x) do if (!(x)) {\
ctlog("%s", "test: " #x);\
Expand Down
4 changes: 2 additions & 2 deletions ct/gen
Expand Up @@ -26,9 +26,9 @@ gen() {

printf 'T ctmain[] = {\n'
for t in "$@"
do printf ' {%s, "%s"},\n' $t $t
do printf ' {%s, "%s", 0, 0},\n' $t $t
done
printf ' {},\n'
printf ' {0, 0, 0, 0},\n'
printf '};\n'
}

Expand Down

0 comments on commit da3754d

Please sign in to comment.