1
0
mirror of http://galexander.org/git/simplesshd.git synced 2024-12-28 00:48: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:
Greg Alexander 2019-07-28 22:26:55 -04:00
parent 7132b50fa1
commit 62b119e07f

View File

@ -141,11 +141,15 @@ Java_org_galexander_sshd_SimpleSSHDService_start_1sshd(JNIEnv *env_,
char *argv[100] = { "sshd", NULL };
int argc = 1;
const char *logfn;
const char *logfn_old;
int logfd;
int retval;
int i;
logfn = conf_path_file("dropbear.err");
logfn_old = conf_path_file("dropbear.err.old");
unlink(logfn_old);
rename(logfn, logfn_old);
unlink(logfn);
logfd = open(logfn, O_CREAT|O_WRONLY, 0666);
if (logfd != -1) {