]> rtime.felk.cvut.cz Git - frescor/frsh-forb.git/blob - src/forb/src/forbrun/tests/forbrun_printargs.c
forb: Fix synchronization error in forbrun
[frescor/frsh-forb.git] / src / forb / src / forbrun / tests / forbrun_printargs.c
1 #include <forb.h>
2 #include <stdio.h>
3 #include <error.h>
4
5 int forb_main(forb_orb orb, int argc, char *argv[])
6 {
7         int i, ret;
8         for (i=0; i<argc; i++)
9                 printf("%s%s", argv[i], i+1 < argc ? " " : "");
10         printf("\n");
11         if (argc < 2 || strcmp(argv[1], "--exit") != 0) {
12                 /* Allow starting the next shared library */
13                 ret = forb_signal_server_ready(orb);
14                 if (ret)
15                         error(1, errno, "forb_signal_server_ready");
16                 /* Exit only this thread, not the whole forbrun */
17                 pthread_exit(0);
18         }
19         return 0;
20 }