Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
d5bb8e8d
Commit
d5bb8e8d
authored
Mar 21, 2011
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tdb2: fix tools compilation.
parent
7a0402de
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
ccan/tdb2/tools/tdbtool.c
ccan/tdb2/tools/tdbtool.c
+2
-7
ccan/tdb2/tools/tdbtorture.c
ccan/tdb2/tools/tdbtorture.c
+12
-7
No files found.
ccan/tdb2/tools/tdbtool.c
View file @
d5bb8e8d
...
...
@@ -21,7 +21,6 @@
*/
#include <ccan/tdb2/tdb2.h>
#include <ccan/hash/hash.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
...
...
@@ -207,8 +206,10 @@ static void help(void)
" store key data : store a record (replace)
\n
"
" show key : show a record by key
\n
"
" delete key : delete a record by key
\n
"
#if 0
" list : print the database hash table and freelist\n"
" free : print the database freelist\n"
#endif
" check : check the integrity of an opened database
\n
"
" speed : perform speed tests on the database
\n
"
" ! command : execute system command
\n
"
...
...
@@ -242,12 +243,6 @@ static void create_tdb(const char *tdbname)
}
}
static
uint64_t
jenkins_hash
(
const
void
*
key
,
size_t
len
,
uint64_t
seed
,
void
*
priv
)
{
return
hash_any
(
key
,
len
,
seed
);
}
static
void
open_tdb
(
const
char
*
tdbname
)
{
union
tdb_attribute
log_attr
;
...
...
ccan/tdb2/tools/tdbtorture.c
View file @
d5bb8e8d
...
...
@@ -64,10 +64,11 @@ static void segv_handler(int signal, siginfo_t *info, void *p)
{
char
string
[
100
];
sprintf
(
string
,
"%u: death at %p (map_ptr %p, map_size %llu)
\n
"
,
getpid
(),
info
->
si_addr
,
db
->
map_ptr
,
db
->
map_size
);
write
(
2
,
string
,
strlen
(
string
));
sleep
(
60
);
sprintf
(
string
,
"%u: death at %p (map_ptr %p, map_size %zu)
\n
"
,
getpid
(),
info
->
si_addr
,
db
->
file
->
map_ptr
,
(
size_t
)
db
->
file
->
map_size
);
if
(
write
(
2
,
string
,
strlen
(
string
))
>
0
)
sleep
(
60
);
_exit
(
11
);
}
...
...
@@ -243,7 +244,8 @@ static void usage(void)
static
void
send_count_and_suicide
(
int
sig
)
{
/* This ensures our successor can continue where we left off. */
write
(
count_pipe
,
&
loopnum
,
sizeof
(
loopnum
));
if
(
write
(
count_pipe
,
&
loopnum
,
sizeof
(
loopnum
))
!=
sizeof
(
loopnum
))
exit
(
2
);
/* This gives a unique signature. */
kill
(
getpid
(),
SIGUSR2
);
}
...
...
@@ -433,8 +435,11 @@ int main(int argc, char * const *argv)
||
WTERMSIG
(
status
)
==
SIGUSR1
)
{
/* SIGUSR2 means they wrote to pipe. */
if
(
WTERMSIG
(
status
)
==
SIGUSR2
)
{
read
(
pfds
[
0
],
&
done
[
j
],
sizeof
(
done
[
j
]));
if
(
read
(
pfds
[
0
],
&
done
[
j
],
sizeof
(
done
[
j
]))
!=
sizeof
(
done
[
j
]))
err
(
1
,
"Short read from child?"
);
}
pids
[
j
]
=
fork
();
if
(
pids
[
j
]
==
0
)
...
...
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