summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2014-07-14 11:55:28 +0000
committerXavier Roche <xroche@users.noreply.github.com>2014-07-14 11:55:28 +0000
commite1149999ce22bb195dd81302be3b5bb64eee31d5 (patch)
treedb46e2830714ae74295b9c9337b6ab1551d11510 /src
parent89a8c3134d13abb5da84fec0b1df964400fd8765 (diff)
Fixed WIN32
Diffstat (limited to 'src')
-rw-r--r--src/httrack.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/src/httrack.c b/src/httrack.c
index 3c17d27..5ae2008 100644
--- a/src/httrack.c
+++ b/src/httrack.c
@@ -837,6 +837,43 @@ static void sig_ask(int code) { // demander
}
#endif
+static void sig_brpipe(int code) { // treat if necessary
+ signal(code, sig_brpipe);
+}
+static void sig_doback(int blind) { // mettre en backing
+ int out = -1;
+
+ //
+ printf("\nMoving into background to complete the mirror...\n");
+ fflush(stdout);
+
+ if (global_opt != NULL) {
+ // suppress logging and asking lousy questions
+ global_opt->quiet = 1;
+ global_opt->verbosedisplay = 0;
+ }
+
+ if (!blind)
+ out = open("hts-nohup.out", O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR);
+ if (out == -1)
+ out = open("/dev/null", O_WRONLY, S_IRUSR | S_IWUSR);
+ dup2(out, 0);
+ dup2(out, 1);
+ dup2(out, 2);
+ //
+ switch (fork()) {
+ case 0:
+ break;
+ case -1:
+ fprintf(stderr, "Error: can not fork process\n");
+ break;
+ default: // pere
+ _exit(0);
+ break;
+ }
+}
+#endif
+
#undef FD_ERR
#define FD_ERR 2
@@ -890,43 +927,6 @@ static void sig_fatal(int code) {
#undef FD_ERR
-static void sig_brpipe(int code) { // treat if necessary
- signal(code, sig_brpipe);
-}
-static void sig_doback(int blind) { // mettre en backing
- int out = -1;
-
- //
- printf("\nMoving into background to complete the mirror...\n");
- fflush(stdout);
-
- if (global_opt != NULL) {
- // suppress logging and asking lousy questions
- global_opt->quiet = 1;
- global_opt->verbosedisplay = 0;
- }
-
- if (!blind)
- out = open("hts-nohup.out", O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR);
- if (out == -1)
- out = open("/dev/null", O_WRONLY, S_IRUSR | S_IWUSR);
- dup2(out, 0);
- dup2(out, 1);
- dup2(out, 2);
- //
- switch (fork()) {
- case 0:
- break;
- case -1:
- fprintf(stderr, "Error: can not fork process\n");
- break;
- default: // pere
- _exit(0);
- break;
- }
-}
-#endif
-
static void sig_leave(int code) {
if (global_opt != NULL && global_opt->state._hts_in_mirror) {
signal(code, sig_term); // quitter si encore