Skip to content

Commit

Permalink
automatic commit at releng box
Browse files Browse the repository at this point in the history
  • Loading branch information
mc36 committed Mar 28, 2022
1 parent 3fb9180 commit 556af7d
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 3 deletions.
2 changes: 1 addition & 1 deletion misc/native/c.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ for fn in ptyRun; do
compileFile $fn "" "-lutil" ""
done

for fn in dummyCon; do
for fn in dummyCon daemonRun; do
compileFile $fn "" "" ""
done
43 changes: 43 additions & 0 deletions misc/native/daemonRun.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <signal.h>


void err(char*buf) {
printf("%s\n", buf);
exit(1);
}


int main(int argc, char **argv) {

if (argc < 2) err("using: daemon <bin> [args]");

if (close(STDIN_FILENO) != 0) err("error closing stdin");
if (close(STDOUT_FILENO) != 0) err("error closing stdout");
if (close(STDERR_FILENO) != 0) err("error closing stderr");

sigset_t mask;
if (sigfillset(&mask) != 0) err("error setting mask");
if (sigprocmask(SIG_SETMASK, &mask, NULL) != 0) err("error masking signals");

int i = fork();
if (i == -1) err("failed to fork");
if (i != 0) err("normal termination");

i = fork();
if (i == -1) err("failed to fork");
if (i != 0) err("normal termination");

if (dup2(open("/dev/null", O_RDONLY), STDIN_FILENO) == -1) err("error redirecting stdin");
if (dup2(open("/dev/null", O_RDWR), STDOUT_FILENO) == -1) err("error redirecting stdout");
if (dup2(open("/dev/null", O_RDWR), STDERR_FILENO) == -1) err("error redirecting stderr");

if (chdir("/") == -1) err("error changing directory");

if (execvp(argv[1], &(argv[1])) == -1) err("error executing process");
return 0;
}
2 changes: 1 addition & 1 deletion src/rtr.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
url;file;result;test
-;-;-;freeRouter v22.3.28-cur, done by cs@nop.
-;-;-;2022-03-28 08:51:25, took 00:07:51, with 100 workers, on 2780 cases, 0 failed, 0 traces, 9 retries
-;-;-;2022-03-28 09:32:44, took 00:07:52, with 100 workers, on 2780 cases, 0 failed, 0 traces, 10 retries
-;-;-;./rtr.bin
http://sources.freertr.net/cfg/basic.tst;basic.tst;success;dummy test
http://sources.freertr.net/cfg/conn-amt01.tst;conn-amt01.tst;success;amt over ipv4
Expand Down
2 changes: 1 addition & 1 deletion src/rtr.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</style>
<title>tester</title></head><body>
release: freeRouter v22.3.28-cur, done by cs@nop.<br/>
tested: 2022-03-28 08:51:25, took 00:07:51, with 100 workers, on 2780 cases, 0 failed, 0 traces, 9 retries<br/>
tested: 2022-03-28 09:32:44, took 00:07:52, with 100 workers, on 2780 cases, 0 failed, 0 traces, 10 retries<br/>
jvm: ./rtr.bin<br/>
<br/>
<table><thead><tr><td><b>file</b></td><td><b>result</b></td><td><b>test</b></td></tr></thead><tbody>
Expand Down

0 comments on commit 556af7d

Please sign in to comment.