rem: base.Append("syslog.old"); rename(syslog.Path(), base.Path());
add: BPath oldlog(base); oldlog.Append("syslog.old");
context: prepare_output(){	bool needNew = true;	bool tooLarge = false;	if (sLog > 0) {		// check file size		struct stat stat;		if (fstat(sLog, &stat) == 0) {			if (stat.st_size < kMaxLogSize)				needNew = false;			else				tooLarge = true;		}	}	if (needNew) {		// get path		BPath base;		find_directory(/*B_COMMON_LOG_DIRECTORY*/B_COMMON_TEMP_DIRECTORY, &base);			// ToDo: change to correct "which" parameter!		BPath syslog(base);		syslog.Append("syslog");		// move old file if it already exists		if (tooLarge) {			base.Append("syslog.old");			rename(syslog.Path(), base.Path());			// ToDo: remove old file if space on device is tight?		}		// open file		sLog = open(syslog.Path(), O_APPEND | O_CREAT | O_WRONLY, 644);	}	return sLog >= 0 ? B_OK : B_ERROR;}