Исправил сохранение

pull/24/head
Igor Belitskiy 2 years ago
parent 76b4e143c5
commit a9ade5adcf

@ -49,11 +49,11 @@ char* save_format_status_cmd_all(vector* vec_temp, vector* vec_status_disk) {
config_u_g_p* _config = (config_u_g_p*)vec_temp->pfVectorGet(vec_temp, i); config_u_g_p* _config = (config_u_g_p*)vec_temp->pfVectorGet(vec_temp, i);
for (int j=0; j < vec_status_disk->vectorList.total;j++) { for (int j=0; j < vec_status_disk->vectorList.total;j++) {
disk_status* config_disk_status = (disk_status*)vec_status_disk->pfVectorGet(vec_status_disk, j); disk_status* config_disk_status = (disk_status*)vec_status_disk->pfVectorGet(vec_status_disk, j);
if (strstr(config_disk_status->device, _config->UNIX_file) && strstr(config_disk_status->device, _config->type_arr) ) { if (strstr(config_disk_status->device, _config->UNIX_file) ) {
str_cmd_format = save_format_status_cmd(config_disk_status, _config); str_cmd_format = save_format_status_cmd(config_disk_status, _config);
if (str_cmd_format) { if (str_cmd_format) {
cmd = yon_char_unite(cmd, " ", str_cmd_format, NULL); cmd = yon_char_unite(cmd, " ", str_cmd_format, NULL);
free(cmd); free(str_cmd_format);
} }
} }
} }
@ -118,7 +118,10 @@ char* template_format_remove_save_device(config_all* _all_config, char* source_r
cmd = yon_char_unite(cmd, " DISK_QUOTA[prjquota" , _config->device, "] ", NULL); cmd = yon_char_unite(cmd, " DISK_QUOTA[prjquota" , _config->device, "] ", NULL);
} }
} }
return cmd; if (strlen(cmd)>2) {
return cmd;
}
} }
return NULL; return NULL;
} }
@ -139,7 +142,7 @@ int wrapper_template_save(config_all* _all_config, char* source_set_cmd, char* s
philos_config_save(str_cmd_set); philos_config_save(str_cmd_set);
} }
if (str_cmd_remove_device != NULL) { if (str_cmd_remove_device != NULL) {
philos_config_save(yon_char_unite(source_remove_cmd, " " , str_cmd_set, NULL)); philos_config_save(yon_char_unite(source_remove_cmd, " " , str_cmd_remove_device, NULL));
} }
} }

Loading…
Cancel
Save