mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
cosmetic restructuring
This commit is contained in:
parent
89e070b6ce
commit
d27d5d47f2
@ -160,14 +160,20 @@ do_autorestart() {
|
|||||||
perror("sigaction");
|
perror("sigaction");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* If we have a logfile, dup it onto stdout and stderr. */
|
|
||||||
if (logfile_fd >= 0) {
|
if (logfile_fd >= 0) {
|
||||||
|
/* If we have a logfile, dup it onto stdout and stderr. */
|
||||||
dup2(logfile_fd, STDOUT_FILENO);
|
dup2(logfile_fd, STDOUT_FILENO);
|
||||||
dup2(logfile_fd, STDERR_FILENO);
|
dup2(logfile_fd, STDERR_FILENO);
|
||||||
close(logfile_fd);
|
close(logfile_fd);
|
||||||
|
} else {
|
||||||
|
/* Otherwise, close them. */
|
||||||
|
close(STDOUT_FILENO);
|
||||||
|
close(STDERR_FILENO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Make sure stdin is closed. */
|
||||||
|
close(STDIN_FILENO);
|
||||||
|
|
||||||
now = time(NULL);
|
now = time(NULL);
|
||||||
strftime(time_buffer, TIME_BUFFER_SIZE, "%T on %A, %d %b %Y", localtime(&now));
|
strftime(time_buffer, TIME_BUFFER_SIZE, "%T on %A, %d %b %Y", localtime(&now));
|
||||||
fprintf(stderr, "autorestart begun at %s.\n", time_buffer);
|
fprintf(stderr, "autorestart begun at %s.\n", time_buffer);
|
||||||
@ -328,9 +334,6 @@ main(int argc, char *argv[]) {
|
|||||||
fprintf(stderr, "Generating output to %s.\n", logfile_name);
|
fprintf(stderr, "Generating output to %s.\n", logfile_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure standard input is closed. */
|
|
||||||
close(STDIN_FILENO);
|
|
||||||
|
|
||||||
double_fork();
|
double_fork();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user