Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
uplex-varnish
unique-xids
Commits
b530ed43
Commit
b530ed43
authored
Mar 11, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://git.varnish-cache.org/git/varnish-cache
parents
1ebd8615
7058d471
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
15 deletions
+21
-15
varnishadm.c
bin/varnishadm/varnishadm.c
+21
-15
No files found.
bin/varnishadm/varnishadm.c
View file @
b530ed43
...
@@ -55,9 +55,9 @@ SVNID("$Id$")
...
@@ -55,9 +55,9 @@ SVNID("$Id$")
do { \
do { \
rl_callback_handler_remove(); \
rl_callback_handler_remove(); \
exit(status); \
exit(status); \
} while (0)
;
} while (0)
#else
#else
#define RL_EXIT(status) exit(status)
;
#define RL_EXIT(status) exit(status)
#endif
#endif
static
double
timeout
=
5
;
static
double
timeout
=
5
;
...
@@ -193,7 +193,9 @@ pass(int sock)
...
@@ -193,7 +193,9 @@ pass(int sock)
{
{
struct
pollfd
fds
[
2
];
struct
pollfd
fds
[
2
];
char
buf
[
1024
];
char
buf
[
1024
];
int
i
,
n
,
m
;
int
i
,
n
;
char
*
answer
=
NULL
;
unsigned
u
,
status
;
#ifdef HAVE_LIBEDIT
#ifdef HAVE_LIBEDIT
_line_sock
=
sock
;
_line_sock
=
sock
;
...
@@ -214,20 +216,24 @@ pass(int sock)
...
@@ -214,20 +216,24 @@ pass(int sock)
i
=
poll
(
fds
,
2
,
-
1
);
i
=
poll
(
fds
,
2
,
-
1
);
assert
(
i
>
0
);
assert
(
i
>
0
);
if
(
fds
[
0
].
revents
&
POLLIN
)
{
if
(
fds
[
0
].
revents
&
POLLIN
)
{
n
=
read
(
fds
[
0
].
fd
,
buf
,
sizeof
buf
);
/* Get rid of the prompt, kinda hackish */
if
(
n
==
0
)
u
=
write
(
1
,
"
\r
\r
"
,
13
);
u
=
cli_readres
(
fds
[
0
].
fd
,
&
status
,
&
answer
,
timeout
);
if
(
u
)
{
if
(
status
==
CLIS_COMMS
)
RL_EXIT
(
0
);
RL_EXIT
(
0
);
if
(
n
<
0
)
{
if
(
answer
)
perror
(
"Read error reading CLI socket"
);
fprintf
(
stderr
,
"%s
\n
"
,
answer
);
RL_EXIT
(
1
);
RL_EXIT
(
1
);
}
}
assert
(
n
>
0
);
/* Get rid of the prompt, kinda hackish */
sprintf
(
buf
,
"%u
\n
"
,
status
);
write
(
1
,
"
\r
\r
"
,
13
);
u
=
write
(
1
,
buf
,
strlen
(
buf
));
m
=
write
(
1
,
buf
,
n
);
if
(
answer
)
{
if
(
n
!=
m
)
{
u
=
write
(
1
,
answer
,
strlen
(
answer
));
perror
(
"Write error writing stdout"
);
u
=
write
(
1
,
"
\n
"
,
1
);
RL_EXIT
(
1
);
free
(
answer
);
answer
=
NULL
;
}
}
#ifdef HAVE_LIBEDIT
#ifdef HAVE_LIBEDIT
rl_forced_update_display
();
rl_forced_update_display
();
...
...
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