/* check */
if (time1 == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return -1;
}
if (time2 == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return -1;
}
/* check */
if (entry == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return 0;
}
int dir_num;
struct dirent **dir_list;
int i, j;
-
char *tmp_str_uuid;
PTS_UUID *tmp_uuid;
PTS_DateTime *tmp_time;
int tmp_state;
char *tmp_dir;
-
OPENPTS_RMSET *rmset;
OPENPTS_RMSET *rmset1;
OPENPTS_RMSET *rmset2;
- // printf("Show RMs by UUID\n");
- // printf("config dir : %s\n", config_dir);
-
/* check */
if (conf == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return PTS_FATAL;
}
if (config_dir == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return PTS_FATAL;
}
/* move to config dir */
if ((chdir(conf->config_dir)) != 0) {
- fprintf(stderr, "Accessing config directory %s\n", conf->config_dir);
+ ERROR( // TODO NLS
+ "Accessing config directory %s\n", conf->config_dir);
return PTS_INTERNAL_ERROR;
}
/* scan dirs */
dir_num = scandir(".", &dir_list, &selectUuidDir, NULL);
if ( dir_num == -1 ) {
- fprintf(stderr, "no target data\n");
+ ERROR( // TODO NLS
+ "No target data.\n");
return PTS_INTERNAL_ERROR;
}
for (cnt = 0; cnt < dir_num; cnt++) {
rmset = &conf->rmsets->rmset[cnt];
if (rmset == NULL) {
- ERROR("no memory cnt=%d\n", cnt);
+ LOG(LOG_ERR, "no memory cnt=%d\n", cnt);
return PTS_INTERNAL_ERROR;
}
rmset->str_uuid = smalloc(dir_list[cnt]->d_name);
/* sort (bub) */
for (i = 0; i< dir_num - 1; i++) {
for (j = dir_num - 1; j > i; j--) {
- // printf("i=%d, j=%d\n",i,j);
rmset1 = &conf->rmsets->rmset[j-1];
rmset2 = &conf->rmsets->rmset[j];
if (cmpDateTime(rmset1->time, rmset2->time) > 0) {
- // printf("%d <-> %d\n", j-1, j);
-
tmp_str_uuid = rmset2->str_uuid;
tmp_uuid = rmset2->uuid;
tmp_time = rmset2->time;
/* check */
if (dir == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return PTS_FATAL;
}
/* check */
if (conf == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return PTS_FATAL;
}
if (conf->rmsets == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return PTS_FATAL;
}
state = rmset->state;
if (state == OPENPTS_RM_STATE_TRASH) {
- INFO(NLS(MS_OPENPTS, OPENPTS_PURGE_RENEWED_RM, " purge %s\n"), rmset->str_uuid);
+ // INFO(NLS(MS_OPENPTS, OPENPTS_PURGE_RENEWED_RM, " purge %s\n"), rmset->str_uuid);
+ LOG(LOG_INFO, " purge %s\n", rmset->str_uuid);
rc = rmRmsetDir(rmset->dir);
if (rc != PTS_SUCCESS) {
rc2 = PTS_OS_ERROR;
/* check */
if (conf == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return;
}
if (conf->rmsets == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return;
}
/* check */
if (conf == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return PTS_FATAL;
}
if (config_dir == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return PTS_FATAL;
}
if (conf->target_list != NULL) {
/* move to config dir */
if ((chdir(conf->config_dir)) != 0) {
- ERROR("Accessing config directory %s\n", conf->config_dir);
+ LOG(LOG_ERR, "Accessing config directory %s\n", conf->config_dir);
return PTS_INTERNAL_ERROR;
}
/* scan dirs */
dir_num = scandir(".", &dir_list, &selectUuidDir, NULL);
if ( dir_num == -1 ) {
- ERROR("no target data\n");
+ LOG(LOG_ERR, "no target data\n");
return PTS_INTERNAL_ERROR;
}
/* set RM UUID (Mandatory) */
rc = readOpenptsUuidFile(target_conf->rm_uuid);
if (rc != PTS_SUCCESS) {
- ERROR("getTargetList() - readOpenptsUuidFile() fail rc=%d\n", rc);
+ LOG(LOG_ERR, "getTargetList() - readOpenptsUuidFile() fail rc=%d\n", rc);
freeOpenptsUuid(target_conf->rm_uuid);
target_conf->rm_uuid = NULL;
return PTS_INTERNAL_ERROR;
/* check */
if (conf == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return NULL;
}
if (conf->hostname == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return NULL;
}
if (conf->target_list == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return NULL;
}
/* check */
if (conf == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return NULL;
}
if (conf->hostname == NULL) {
- ERROR("null hostname");
+ LOG(LOG_ERR, "null hostname");
return NULL;
}
if (conf->target_list == NULL) {
/* check */
if (conf == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return NULL;
}
if (conf->target_list == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return NULL;
}
if (uuid == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return NULL;
}
/* check */
if (conf == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return;
}
if (conf->target_list == NULL) {
- ERROR("null input");
+ LOG(LOG_ERR, "null input");
return;
}
num = conf->target_list->target_num;
if (num == 0) {
- printf("There is no enrolled target platform.\n");
+ OUTPUT( // TODO NLS
+ "There is no enrolled target platform.\n");
return;
}
target_conf->ssh_port ? target_conf->ssh_port : "default");
} else {
DEBUG("target[%d] is NULL, SKIP\n", cnt);
- // printf("--\n");
}
}
OUTPUT("%s%s\n", indent, SEP_LINE);