Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
9df66bc7
Commit
9df66bc7
authored
Oct 02, 2015
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backup fix for reading old V4.6 versions of backup file
parent
ec9b7473
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
5 deletions
+33
-5
src/lib/rt/src/rt_bck_load.c
src/lib/rt/src/rt_bck_load.c
+8
-4
src/lib/rt/src/rt_bckdef.h
src/lib/rt/src/rt_bckdef.h
+25
-1
No files found.
src/lib/rt/src/rt_bck_load.c
View file @
9df66bc7
...
...
@@ -146,8 +146,10 @@ bck_LoadBackup ()
errh_Info
(
"BACKUP Loading old file version : %d"
,
fh
.
version
);
/* Read the cycle data. */
BCK_FILEHEAD_STRUCT_V6
*
fhp_v6
=
(
BCK_FILEHEAD_STRUCT_V6
*
)
&
fh
;
for
(
c
=
0
;
c
<
2
;
c
++
)
{
fseek
(
f
,
fh
.
curdata
[
c
],
0
);
fseek
(
f
,
fh
p_v6
->
curdata
[
c
],
0
);
fread
(
&
ch_old
,
sizeof
ch_old
,
1
,
f
);
/* Work thru the data segments */
...
...
@@ -197,14 +199,16 @@ bck_LoadBackup ()
}
else
if
(
fh
.
version
==
BCK_FILE_VERSION
-
1
)
{
/* Read the cycle data. */
BCK_FILEHEAD_STRUCT_V6
*
fhp_v6
=
(
BCK_FILEHEAD_STRUCT_V6
*
)
&
fh
;
BCK_CYCLEHEAD_STRUCT_V6
ch_v6
;
for
(
c
=
0
;
c
<
2
;
c
++
)
{
fseek
(
f
,
fh
.
curdata
[
c
],
0
);
fread
(
&
ch_
old
,
sizeof
ch_old
,
1
,
f
);
fseek
(
f
,
fh
p_v6
->
curdata
[
c
],
0
);
fread
(
&
ch_
v6
,
sizeof
ch_v6
,
1
,
f
);
/* Work thru the data segments */
for
(
d
=
0
;
d
<
ch_
old
.
segments
;
d
++
)
{
for
(
d
=
0
;
d
<
ch_
v6
.
segments
;
d
++
)
{
csts
=
fread
(
&
dh
,
sizeof
dh
,
1
,
f
);
if
(
csts
!=
0
)
{
if
(
dh
.
namesize
>
0
)
{
...
...
src/lib/rt/src/rt_bckdef.h
View file @
9df66bc7
...
...
@@ -41,6 +41,7 @@
#endif
#include "pwr.h"
#include "rt_net.h"
/* Trace flag: Define BCK_TRACE for trace printouts */
...
...
@@ -93,15 +94,38 @@ typedef struct {
}
BCK_FILEHEAD_STRUCT
;
/* File header for Version 6 and previous */
typedef
struct
{
pwr_tInt32
version
;
/* File layout version */
net_sTime
creationtime
;
/* Time when file was created */
net_sTime
updatetime
[
2
];
/* Time when header was last updated */
pwr_tInt32
curdata
[
2
];
/* backup data 0 for fast cycle, and */
/* 1 for slow. Contains file address */
pwr_tInt32
cursize
[
2
];
/* size in bytes of curdata areas */
/* Node identification */
pwr_tNodeId
nodidx
;
/* node index that produced the file */
}
BCK_FILEHEAD_STRUCT_V6
;
/* Each data section starts with a cycle header. */
typedef
struct
{
pwr_t
Time
objtime
;
/* Time up to which new objects are included */
net_s
Time
objtime
;
/* Time up to which new objects are included */
pwr_tUInt32
length
;
/* Length of section including this header */
pwr_tUInt16
cycle
;
/* 0=fast, 1=slow */
pwr_tUInt16
segments
;
/* # of segments in section */
}
BCK_CYCLEHEAD_STRUCT
;
typedef
struct
{
net_sTime
objtime
;
/* Time up to which new objects are included */
pwr_tUInt32
length
;
/* Length of section including this header */
pwr_tUInt16
cycle
;
/* 0=fast, 1=slow */
pwr_tUInt32
segments
;
/* # of segments in section */
}
BCK_CYCLEHEAD_STRUCT_V6
;
typedef
struct
{
pwr_tTime
objtime
;
/* Time up to which new objects are included */
pwr_tUInt32
length
;
/* Length of section including this header */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment