Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
1a5f111d
Commit
1a5f111d
authored
Oct 06, 2010
by
Pieter Noordhuis
Browse files
c->error is no longer a redisReply object, but rather a plain C-string
parent
97920b44
Changes
2
Show whitespace changes
Inline
Side-by-side
example.c
View file @
1a5f111d
...
@@ -11,7 +11,7 @@ int main(void) {
...
@@ -11,7 +11,7 @@ int main(void) {
c
=
redisConnect
((
char
*
)
"127.0.0.1"
,
6379
,
NULL
);
c
=
redisConnect
((
char
*
)
"127.0.0.1"
,
6379
,
NULL
);
if
(
c
->
error
!=
NULL
)
{
if
(
c
->
error
!=
NULL
)
{
printf
(
"Connection error: %s"
,
((
redisReply
*
)
c
->
error
)
->
reply
);
printf
(
"Connection error: %s"
,
c
->
error
);
exit
(
1
);
exit
(
1
);
}
}
...
...
test.c
View file @
1a5f111d
...
@@ -16,10 +16,11 @@ static long long usec(void) {
...
@@ -16,10 +16,11 @@ static long long usec(void) {
return
(((
long
long
)
tv
.
tv_sec
)
*
1000000
)
+
tv
.
tv_usec
;
return
(((
long
long
)
tv
.
tv_sec
)
*
1000000
)
+
tv
.
tv_usec
;
}
}
static
void
__connect
(
redisContext
**
c
)
{
static
void
__connect
(
redisContext
**
target
)
{
*
c
=
redisConnect
((
char
*
)
"127.0.0.1"
,
6379
,
NULL
);
redisContext
*
c
;
if
((
*
c
)
->
error
!=
NULL
)
{
c
=
*
target
=
redisConnect
((
char
*
)
"127.0.0.1"
,
6379
,
NULL
);
printf
(
"Connection error: %s"
,
((
redisReply
*
)(
*
c
)
->
error
)
->
reply
);
if
(
c
->
error
!=
NULL
)
{
printf
(
"Connection error: %s"
,
c
->
error
);
exit
(
1
);
exit
(
1
);
}
}
}
}
...
...
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