version 1.6, 2025/04/13 04:22:43
|
version 1.7, 2025/04/13 15:12:21
|
Line 24
|
Line 24
|
* along with FreeM. If not, see <https://www.gnu.org/licenses/>. |
* along with FreeM. If not, see <https://www.gnu.org/licenses/>. |
* |
* |
* $Log$ |
* $Log$ |
|
* Revision 1.7 2025/04/13 15:12:21 snw |
|
* Fix transaction checkpoints on OS/2 [CLOSES #34] |
|
* |
* Revision 1.6 2025/04/13 04:22:43 snw |
* Revision 1.6 2025/04/13 04:22:43 snw |
* Fix snprintf calls |
* Fix snprintf calls |
* |
* |
Line 50
|
Line 53
|
#include "journal.h" |
#include "journal.h" |
#include "fs.h" |
#include "fs.h" |
|
|
|
#if defined(__OS2__) |
|
# include <os2.h> |
|
#endif |
|
|
short frm_global_exists(char *, char *, char *); |
short frm_global_exists(char *, char *, char *); |
|
|
cptab *cptab_head[TP_MAX_NEST]; |
cptab *cptab_head[TP_MAX_NEST]; |
Line 200 void cptab_postcommit(int tlevel)
|
Line 207 void cptab_postcommit(int tlevel)
|
short cptab_rollback(int tlevel) |
short cptab_rollback(int tlevel) |
{ |
{ |
cptab *t; |
cptab *t; |
/*char *cmd;*/ |
|
int rc; |
int rc; |
|
|
/* |
|
cmd = (char *) malloc (STRLEN * sizeof (char)); |
|
NULLPTRCHK(cmd,"cptab_rollback"); |
|
*/ |
|
|
|
for (t = cptab_head[tlevel]; t != NULL; t = t->next) { |
for (t = cptab_head[tlevel]; t != NULL; t = t->next) { |
|
|
switch (t->mode) { |
switch (t->mode) { |
|
|
case CP_REMOVE: |
case CP_REMOVE: |
unlink (t->file); |
unlink (t->file); |
/* |
|
snprintf (cmd, STRLEN - 1, "/bin/rm -f '%s'", t->file); |
|
rc = system (cmd); |
|
*/ |
|
break; |
break; |
|
|
case CP_RESTORE: |
case CP_RESTORE: |
/* |
#if !defined(__OS2__) |
snprintf (cmd, STRLEN - 1, "/bin/cp '%s' '%s'", t->cp_file, t->file); |
|
rc = system (cmd); |
|
*/ |
|
/* TODO: support OS/2 */ |
|
rc = cp (t->file, t->cp_file); |
rc = cp (t->file, t->cp_file); |
|
#else |
|
rc = DosCopy (t->cp_file, t->file, 1); |
|
#endif |
if (rc != 0) { |
if (rc != 0) { |
cptab_head[tlevel] = NULL; |
cptab_head[tlevel] = NULL; |
/*free (cmd);*/ |
/*free (cmd);*/ |
return FALSE; |
return FALSE; |
} |
} |
|
|
/* |
|
snprintf (cmd, STRLEN - 1, "/bin/rm -f %s", t->cp_file); |
|
rc = system (cmd); |
|
*/ |
|
|
|
unlink (t->cp_file); |
unlink (t->cp_file); |
if (rc != 0) { |
if (rc != 0) { |
cptab_head[tlevel] = NULL; |
cptab_head[tlevel] = NULL; |