- introduced "stopexe run"
- fixed "task ps" to show names containing ':' correctly
This commit is contained in:
@ -501,7 +501,10 @@ int StopExe(pExeList self, char *name)
|
|||||||
self->iRun = 0;
|
self->iRun = 0;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
if (strcasecmp(name, "run") == 0) {
|
||||||
|
TaskSignalGroup(self->pTask, SICSINT, &interrupt, self->runID);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
TaskSignalGroup(self->pTask, SICSINT, &interrupt, self->waitID);
|
TaskSignalGroup(self->pTask, SICSINT, &interrupt, self->waitID);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
6
task.c
6
task.c
@ -508,15 +508,15 @@ char *TaskDescription(pTaskHead it)
|
|||||||
}
|
}
|
||||||
memset(result,0,length*sizeof(char));
|
memset(result,0,length*sizeof(char));
|
||||||
strcpy(result,it->name);
|
strcpy(result,it->name);
|
||||||
strcat(result,":");
|
strcat(result,"|");
|
||||||
|
|
||||||
length = strlen(result);
|
length = strlen(result);
|
||||||
tm = localtime((const time_t *)&it->start_time);
|
tm = localtime((const time_t *)&it->start_time);
|
||||||
strftime(result+length,100,"%F-%k-%m-%S",tm);
|
strftime(result+length,100,"%F-%k-%m-%S",tm);
|
||||||
length = strlen(result);
|
length = strlen(result);
|
||||||
snprintf(result+length,120-20,":%ld", it->lID);
|
snprintf(result+length,120-20,"|%ld", it->lID);
|
||||||
length = strlen(result);
|
length = strlen(result);
|
||||||
snprintf(result+length,120-40,":%ld", it->groupID);
|
snprintf(result+length,120-40,"|%.0ld ", it->groupID);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
13
taskobj.c
13
taskobj.c
@ -20,7 +20,7 @@ static int ListCmd(pSICSOBJ self, SConnection *pCon, pHdb commandNode,
|
|||||||
pHdb par[], int nPar)
|
pHdb par[], int nPar)
|
||||||
{
|
{
|
||||||
pDynString result = NULL;
|
pDynString result = NULL;
|
||||||
char buffer[256], *pDes, *pPtr, name[80], time[80],id[80];
|
char buffer[256], *pDes, *pPtr, name[80], time[80], id[80], gid[80];
|
||||||
pTaskHead it = NULL;
|
pTaskHead it = NULL;
|
||||||
|
|
||||||
result = CreateDynString(128,128);
|
result = CreateDynString(128,128);
|
||||||
@ -35,11 +35,12 @@ static int ListCmd(pSICSOBJ self, SConnection *pCon, pHdb commandNode,
|
|||||||
for(it = TaskIteratorStart(pServ->pTasker); it != NULL; it = TaskIteratorNext(it)){
|
for(it = TaskIteratorStart(pServ->pTasker); it != NULL; it = TaskIteratorNext(it)){
|
||||||
pDes = TaskDescription(it);
|
pDes = TaskDescription(it);
|
||||||
if(pDes != NULL){
|
if(pDes != NULL){
|
||||||
pPtr = stptok(pDes,name,sizeof(name),":");
|
pPtr = stptok(pDes,name,sizeof(name),"|");
|
||||||
pPtr = stptok(pPtr,time,sizeof(name),":");
|
pPtr = stptok(pPtr,time,sizeof(time),"|");
|
||||||
pPtr = stptok(pPtr,id,sizeof(name),":");
|
pPtr = stptok(pPtr,id,sizeof(id),"|");
|
||||||
snprintf(buffer,sizeof(buffer),"%20s %20s %12s",
|
pPtr = stptok(pPtr,gid,sizeof(gid),"|");
|
||||||
name,time,id);
|
snprintf(buffer,sizeof(buffer),"%20s %20s %12s %10s",
|
||||||
|
name,time,id,gid);
|
||||||
DynStringConcat(result,buffer);
|
DynStringConcat(result,buffer);
|
||||||
DynStringConcatChar(result,'\n');
|
DynStringConcatChar(result,'\n');
|
||||||
free(pDes);
|
free(pDes);
|
||||||
|
Reference in New Issue
Block a user