new vers.
This commit is contained in:
21
tecs/tecs.c
21
tecs/tecs.c
@@ -5,6 +5,9 @@
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include "myc_mem.h"
|
||||
#include "myc_err.h"
|
||||
#include "coc_util.h"
|
||||
@@ -14,6 +17,7 @@
|
||||
#include "myc_time.h"
|
||||
#include "tecs_lsc.h"
|
||||
#include "tecs_data.h"
|
||||
#include "logger.h"
|
||||
|
||||
/* --- non ANSI signal --- */
|
||||
#ifndef SIGPIPE
|
||||
@@ -170,7 +174,7 @@ static int
|
||||
lockAlarm,
|
||||
cntError;
|
||||
|
||||
int tim, rdTim; /* actual time, read Time */
|
||||
static int tim, rdTim; /* actual time, read Time */
|
||||
|
||||
static int decod[8]={21,20,17,16,5,4,1,0}; /* for code conversion */
|
||||
|
||||
@@ -2840,6 +2844,7 @@ int main(int argc, char *argv[]) {
|
||||
int i, iret;
|
||||
char *inistr;
|
||||
char buf[256], opt;
|
||||
char loggerDir[256];
|
||||
|
||||
signal(SIGPIPE, ignore_forever);
|
||||
|
||||
@@ -3060,8 +3065,18 @@ int main(int argc, char *argv[]) {
|
||||
str_copy(statusBuf, "starting up");
|
||||
logfileStatusBuf(statusBuf);
|
||||
|
||||
str_copy(buf, logDir);
|
||||
str_append(buf, serverId);
|
||||
if (logDir[0] == '/') {
|
||||
str_copy(buf, logDir);
|
||||
} else {
|
||||
getcwd(buf, sizeof buf);
|
||||
str_append(buf, "/");
|
||||
ERR_I(str_append(buf, logDir));
|
||||
}
|
||||
ERR_I(str_append(buf, serverId));
|
||||
ERR_I(str_copy(loggerDir, buf));
|
||||
mkdir(loggerDir, S_IRWXU+S_IRGRP+S_IXGRP+S_IROTH+S_IXOTH);
|
||||
/* do not check return value */
|
||||
LoggerSetDir(loggerDir);
|
||||
logfile=logfileInit(buf, logIt, use_stdout, logIt && use_stdout);
|
||||
CocDefStr(logfile, RD);
|
||||
logfileOut(LOG_MAIN ,"\n");
|
||||
|
||||
Reference in New Issue
Block a user