#include <direct.h>
#else
#include <dirent.h>
-#include <stdint.h>
#include <errno.h>
+#include <stdint.h>
#include <unistd.h>
#endif
#include <stdio.h>
include Makefiles/archive.mk
include Makefiles/dosbox.mk
include Makefiles/package.mk
+include Makefiles/test.mk
--- /dev/null
+# $Id$
+
+.PHONY: test
+
+test: no-doc
bool connected;
bool fancy = false;
+extern bool usr1sig;
+
extern sig_atomic_t signals;
extern struct dataworks_db* db;
i++;
authfile = argv[i];
auth = true;
+ } else if(option(argv[i], "s", "signal")) {
+ usr1sig = true;
} else if(option(argv[i], "h", "help")) {
printf("\n");
printf("Usage: %s [options] database\n", argv[0]);
printf("\t-p --port [comport] Specify the modem port\n");
printf("\t-f --fancy Enable the fancy manager ;)\n");
printf("\t-l --login [path] Specify the authentication file\n");
+ printf("\t-s --signal Send SIGUSR1 when ready\n");
exit(0);
} else if(option(argv[i], "f", "fancy")) {
fancy = true;
char** argv;
bool auth = false;
char* authfile = NULL;
+bool usr1sig = false;
FILE* authdb;
struct auth_entry {
char* user;
fprintf(stderr, "Failed to open databse\n");
return 1;
}
+ if(usr1sig) {
+ /* Server is ready, raise SIGUSR1 */
+ raise(SIGUSR1);
+ }
server_loop();
}
#endif
extern struct dataworks_db* db;
+extern bool usr1sig;
int server_init(void) {
printf("Using BSD TCP/IP\n");
i++;
authfile = argv[i];
auth = true;
+ } else if(option(argv[i], "s", "signal")) {
+ usr1sig = true;
} else if(option(argv[i], "h", "help")) {
printf("\n");
printf("Usage: %s [options] database\n", argv[0]);
printf("Options:\n");
printf("\t-p --port [port] Specify the port to be listened on\n");
printf("\t-l --login [path] Specify the authentication file\n");
+ printf("\t-s --signal Send SIGUSR1 when ready\n");
exit(0);
} else {
fprintf(stderr, "Invalid option: %s\n", argv[i]);