Subversion Repositories IRCServ

Rev

Rev 3 | Rev 7 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3 Rev 5
Line 1... Line 1...
1
/* $Id: main.c 3 2024-08-25 10:23:36Z nishi $ */
1
/* $Id: main.c 5 2024-08-25 11:58:10Z nishi $ */
2
 
2
 
3
#include "is_version.h"
3
#include "is_version.h"
-
 
4
#include "is_util.h"
-
 
5
#include "is_log.h"
4
 
6
 
5
#include <stdio.h>
7
#include <stdio.h>
-
 
8
#include <stdlib.h>
-
 
9
#include <unistd.h>
-
 
10
#include <stdbool.h>
-
 
11
#include <string.h>
6
 
12
 
7
int main(int argc, char** argv) {
13
int main(int argc, char** argv) {
-
 
14
	bool daemon = true;
8
	printf("Launching IRCServ version %s\n", is_get_version());
15
	printf("IRCServ version %s\n", is_get_version());
-
 
16
	int i;
-
 
17
	for(i = 1; i < argc; i++) {
-
 
18
		if(strcmp(argv[i], "-D") == 0) {
-
 
19
			daemon = false;
-
 
20
			break;
-
 
21
		}
-
 
22
	}
-
 
23
	pid_t pid = 0;
-
 
24
	if(daemon) {
-
 
25
		pid = fork();
-
 
26
	}
-
 
27
	if(pid == 0) {
-
 
28
		char* str;
-
 
29
 
-
 
30
		str = is_strcat("IRCServ version ", is_get_version());
-
 
31
		is_log(str);
-
 
32
		free(str);
-
 
33
 
-
 
34
		return 0;
-
 
35
	} else {
-
 
36
		return 0;
-
 
37
	}
9
}
38
}