]>
glassweightruler.freedombox.rocks Git - Ventoy.git/blob - LinuxGUI/Ventoy2Disk/main.c
10 #include <ventoy_define.h>
11 #include <ventoy_util.h>
12 #include <ventoy_json.h>
13 #include <ventoy_disk.h>
14 #include <ventoy_http.h>
16 int ventoy_log_init(void);
17 void ventoy_log_exit(void);
19 void ventoy_signal_stop(int sig
)
21 vlog("ventoy server exit due to signal ...\n");
22 printf("ventoy server exit ...\n");
31 int main(int argc
, char **argv
)
34 const char *ip
= "127.0.0.1";
35 const char *port
= "24680";
39 printf("Invalid argc %d\n", argc
);
43 if (isdigit(argv
[1][0]))
48 if (isdigit(argv
[2][0]))
55 vlog("===============================================\n");
56 vlog("===== Ventoy2Disk %s %s:%s =====\n", ventoy_get_local_version(), ip
, port
);
57 vlog("===============================================\n");
63 rc
= ventoy_http_start(ip
, port
);
66 printf("failed to start http server\n");
70 signal(SIGINT
, ventoy_signal_stop
);
71 signal(SIGTSTP
, ventoy_signal_stop
);
72 signal(SIGQUIT
, ventoy_signal_stop
);