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
a8078faf
Commit
a8078faf
authored
Mar 23, 2011
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Исправил ошибку в TableBlockStorage приводившую в SEGFAULT если не удалось открыть файл.
parent
49cb2f00
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
10 deletions
+16
-10
libuniset.spec
conf/libuniset.spec
+4
-1
TableBlockStorage.cc
src/Various/TableBlockStorage.cc
+8
-7
TableStorage.cc
src/Various/TableStorage.cc
+4
-2
No files found.
conf/libuniset.spec
View file @
a8078faf
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
Name: libuniset
Name: libuniset
Version: 1.0
Version: 1.0
Release: alt1
1
Release: alt1
2
Summary: UniSet - library for building distributed industrial control systems
Summary: UniSet - library for building distributed industrial control systems
License: GPL
License: GPL
Group: Development/C++
Group: Development/C++
...
@@ -191,6 +191,9 @@ rm -f %buildroot%_libdir/*.la
...
@@ -191,6 +191,9 @@ rm -f %buildroot%_libdir/*.la
%exclude %_pkgconfigdir/libUniSet.pc
%exclude %_pkgconfigdir/libUniSet.pc
%changelog
%changelog
* Wed Mar 23 2011 Pavel Vainerman <pv@altlinux.ru> 1.0-alt12
- fixed bug in TableBlockStorage interface
* Thu Mar 17 2011 Pavel Vainerman <pv@altlinux.ru> 1.0-alt11
* Thu Mar 17 2011 Pavel Vainerman <pv@altlinux.ru> 1.0-alt11
- fixed bug in MBTCPMaster (query optimization)
- fixed bug in MBTCPMaster (query optimization)
...
...
src/Various/TableBlockStorage.cc
View file @
a8078faf
...
@@ -28,14 +28,16 @@
...
@@ -28,14 +28,16 @@
#include "Storages.h"
#include "Storages.h"
TableBlockStorage
::
TableBlockStorage
()
TableBlockStorage
::
TableBlockStorage
()
:
file
(
NULL
),
mem
(
0
)
{
{
file
=
NULL
;
}
}
TableBlockStorage
::
TableBlockStorage
(
const
char
*
name
,
int
byte_sz
,
int
key_sz
,
int
inf_sz
,
int
inf_count
,
int
block_num
,
int
block_lim
,
int
seek
,
bool
cr
)
TableBlockStorage
::
TableBlockStorage
(
const
char
*
name
,
int
byte_sz
,
int
key_sz
,
int
inf_sz
,
int
inf_count
,
int
block_num
,
int
block_lim
,
int
seek
,
bool
cr
)
:
file
(
NULL
),
mem
(
0
)
{
{
file
=
NULL
;
if
(
!
open
(
name
,
byte_sz
,
key_sz
,
inf_sz
,
inf_count
,
block_num
,
block_lim
,
seek
))
if
(
!
open
(
name
,
byte_sz
,
key_sz
,
inf_sz
,
inf_count
,
block_num
,
block_lim
,
seek
))
{
{
if
(
cr
)
if
(
cr
)
...
@@ -47,9 +49,8 @@ TableBlockStorage::TableBlockStorage(const char* name, int byte_sz, int key_sz,
...
@@ -47,9 +49,8 @@ TableBlockStorage::TableBlockStorage(const char* name, int byte_sz, int key_sz,
TableBlockStorage
::~
TableBlockStorage
()
TableBlockStorage
::~
TableBlockStorage
()
{
{
if
(
mem
!=
NULL
)
delete
mem
;
delete
mem
;
if
(
file
!=
NULL
)
fclose
(
file
);
if
(
file
!=
NULL
)
fclose
(
file
);
}
}
bool
TableBlockStorage
::
keyCompare
(
int
i
,
void
*
key
)
bool
TableBlockStorage
::
keyCompare
(
int
i
,
void
*
key
)
...
...
src/Various/TableStorage.cc
View file @
a8078faf
...
@@ -29,7 +29,8 @@
...
@@ -29,7 +29,8 @@
#include "Storages.h"
#include "Storages.h"
TableStorage
::
TableStorage
(
const
char
*
name
,
int
inf_sz
,
int
sz
,
int
seek
)
TableStorage
::
TableStorage
(
const
char
*
name
,
int
inf_sz
,
int
sz
,
int
seek
)
:
file
(
0
)
{
{
file
=
fopen
(
name
,
"r+"
);
file
=
fopen
(
name
,
"r+"
);
inf_size
=
inf_sz
;
inf_size
=
inf_sz
;
...
@@ -105,7 +106,8 @@ TableStorage::TableStorage(const char* name, int inf_sz, int sz, int seek)
...
@@ -105,7 +106,8 @@ TableStorage::TableStorage(const char* name, int inf_sz, int sz, int seek)
TableStorage
::~
TableStorage
()
TableStorage
::~
TableStorage
()
{
{
fclose
(
file
);
if
(
file
)
fclose
(
file
);
}
}
int
TableStorage
::
addRow
(
char
*
key
,
char
*
value
)
int
TableStorage
::
addRow
(
char
*
key
,
char
*
value
)
...
...
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