diff options
author | ramon <ramongomez@us.es> | 2014-05-14 15:56:56 +0000 |
---|---|---|
committer | ramon <ramongomez@us.es> | 2014-05-14 15:56:56 +0000 |
commit | 9a2dc88ecbdb36ed53c79488e363df2d11607f0c (patch) | |
tree | 8e52f0124dc5ad82699ed6f8d9afa6767446ef89 /sources/ogAdmServer.cpp | |
parent | 28cc16b3d87f662a6f949ef0cf17a8e56c938d96 (diff) |
#526: Evitar borrar la configuración de cliente antes de regenerarla.
git-svn-id: https://opengnsys.es/svn/branches/version1.0@4267 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'sources/ogAdmServer.cpp')
-rw-r--r-- | sources/ogAdmServer.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/sources/ogAdmServer.cpp b/sources/ogAdmServer.cpp index 5ac0687..7af9dd5 100644 --- a/sources/ogAdmServer.cpp +++ b/sources/ogAdmServer.cpp @@ -735,17 +735,7 @@ BOOLEAN actualizaConfiguracion(Database db, Table tbl, char* cfg, int ido) char *disk, *par, *cpt, *sfi, *soi, *tam; // Parametros que definen una partición char modulo[] = "actualizaConfiguracion()"; - // UHU - 2013/06/05 - se borra la configuracion actual - sprintf(sqlstr, "DELETE FROM ordenadores_particiones WHERE idordenador=%d", ido); - // Ejecutamos la consulta - if (!db.Execute(sqlstr, tbl)) { // Error al recuperar los datos - errorLog(modulo, 21, FALSE); - db.GetErrorErrStr(msglog); - errorInfo(modulo, msglog); - return (FALSE); - } - - lon = sprintf(tbPar, "("); + lon = 0; p = splitCadena(ptrPar, cfg, '\n'); for (i = 0; i < p; i++) { c = splitCadena(ptrCfg, ptrPar[i], '\t'); @@ -784,7 +774,7 @@ BOOLEAN actualizaConfiguracion(Database db, Table tbl, char* cfg, int ido) splitCadena(ptrDual, ptrCfg[5], '='); tam = ptrDual[1]; // Tamaño de la partición - lon += sprintf(tbPar + lon, "%s,", par); + lon += sprintf(tbPar + lon, "(%s, %s),", disk, par); sprintf(sqlstr, "SELECT numdisk,numpar,codpar,tamano,idsistemafichero,idnombreso" " FROM ordenadores_particiones WHERE idordenador=%d AND numdisk=%s AND numpar=%s", @@ -858,10 +848,10 @@ BOOLEAN actualizaConfiguracion(Database db, Table tbl, char* cfg, int ido) } } } - lon += sprintf(tbPar + lon, "%d)", 0); + lon += sprintf(tbPar + lon, "(0,0)"); // Eliminar particiones almacenadas que ya no existen - sprintf(sqlstr, "DELETE FROM ordenadores_particiones WHERE idordenador=%d AND numdisk=%s AND numpar NOT IN %s", - ido, disk, tbPar); + sprintf(sqlstr, "DELETE FROM ordenadores_particiones WHERE idordenador=%d AND (numdisk, numpar) NOT IN (%s)", + ido, tbPar); if (!db.Execute(sqlstr, tbl)) { // Error al recuperar los datos errorLog(modulo, 21, FALSE); db.GetErrorErrStr(msglog); |