Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
cfce884a
Commit
cfce884a
authored
Sep 17, 2009
by
Ivan Donchevskiy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed segmentation error in TableBlockStorage and CycleStorage
parent
4f798df4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
5 deletions
+18
-5
JrnTest.cc
Utilities/JrnTests/JrnTest.cc
+4
-0
CycleStorage.cc
src/Various/CycleStorage.cc
+11
-3
TableBlockStorage.cc
src/Various/TableBlockStorage.cc
+3
-2
No files found.
Utilities/JrnTests/JrnTest.cc
View file @
cfce884a
...
...
@@ -236,6 +236,10 @@ bool reOpen()
bool
testJournal1
(
void
)
{
CycleStorage
*
jjj
=
new
CycleStorage
();
jjj
->
create
(
"/dev/hdb2"
,
bj_size
,
30
,
32000
,
seek
);
delete
jjj
;
CycleStorage
j
(
"big_file.test"
,
bj_size
,
30
,
32000
,
seek
,
true
);
int
i
,
k
=
0
;
char
*
str
=
new
char
[
30
];
...
...
src/Various/CycleStorage.cc
View file @
cfce884a
...
...
@@ -47,7 +47,7 @@ CycleStorage::CycleStorage(const char* name, int byte_sz, int inf_sz, int inf_co
CycleStorage
::~
CycleStorage
()
{
fclose
(
file
);
if
(
file
!=
NULL
)
fclose
(
file
);
}
void
*
CycleStorage
::
valPointer
(
void
*
pnt
)
...
...
@@ -142,7 +142,12 @@ bool CycleStorage::findHead()
bool
CycleStorage
::
checkAttr
(
int
inf_sz
,
int
inf_count
,
int
seek
)
{
if
(
file
==
NULL
)
return
false
;
fseek
(
file
,
seek
,
0
);
if
(
fseek
(
file
,
seek
,
0
)
==-
1
)
{
fclose
(
file
);
file
=
NULL
;
return
false
;
}
/*! */
CycleStorageAttr
csa
;
...
...
@@ -215,11 +220,14 @@ bool CycleStorage::create(const char* name, int byte_sz, int inf_sz, int inf_cou
/*! , */
if
(
file
==
NULL
)
{
FILE
*
f
=
fopen
(
name
,
"w"
);
FILE
*
f
=
fopen
(
name
,
"w"
);
if
(
f
==
NULL
)
return
false
;
fclose
(
f
);
file
=
fopen
(
name
,
"r+"
);
}
if
(
file
==
NULL
)
return
false
;
if
(
fseek
(
file
,
seekpos
,
0
)
==-
1
)
return
false
;
CycleStorageElem
*
jrn
=
(
CycleStorageElem
*
)
new
char
[
full_size
];
...
...
src/Various/TableBlockStorage.cc
View file @
cfce884a
...
...
@@ -49,7 +49,7 @@ TableBlockStorage::TableBlockStorage(const char* name, int byte_sz, int key_sz,
TableBlockStorage
::~
TableBlockStorage
()
{
delete
mem
;
if
(
mem
!=
NULL
)
delete
mem
;
if
(
file
!=
NULL
)
fclose
(
file
);
}
...
...
@@ -228,7 +228,8 @@ bool TableBlockStorage::create(const char* name, int byte_sz, int key_sz, int in
if
(
file
==
NULL
)
{
FILE
*
f
=
fopen
(
name
,
"w"
);
FILE
*
f
=
fopen
(
name
,
"w"
);
if
(
f
==
NULL
)
return
false
;
fclose
(
f
);
file
=
fopen
(
name
,
"r+"
);
}
...
...
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