mirror of
http://galexander.org/git/simplesshd.git
synced 2024-12-29 09:28:07 +00:00
Keep around a copy of the old dropbear.err so that it can be accessed
after the server is re-started for a crash (to get easy access to the crash dump).
This commit is contained in:
parent
7132b50fa1
commit
62b119e07f
@ -141,11 +141,15 @@ Java_org_galexander_sshd_SimpleSSHDService_start_1sshd(JNIEnv *env_,
|
|||||||
char *argv[100] = { "sshd", NULL };
|
char *argv[100] = { "sshd", NULL };
|
||||||
int argc = 1;
|
int argc = 1;
|
||||||
const char *logfn;
|
const char *logfn;
|
||||||
|
const char *logfn_old;
|
||||||
int logfd;
|
int logfd;
|
||||||
int retval;
|
int retval;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
logfn = conf_path_file("dropbear.err");
|
logfn = conf_path_file("dropbear.err");
|
||||||
|
logfn_old = conf_path_file("dropbear.err.old");
|
||||||
|
unlink(logfn_old);
|
||||||
|
rename(logfn, logfn_old);
|
||||||
unlink(logfn);
|
unlink(logfn);
|
||||||
logfd = open(logfn, O_CREAT|O_WRONLY, 0666);
|
logfd = open(logfn, O_CREAT|O_WRONLY, 0666);
|
||||||
if (logfd != -1) {
|
if (logfd != -1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user