Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
adbc2d33
Commit
adbc2d33
authored
Jan 28, 2016
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "lxc-ls: Restore old [filter] behaviour"
This reverts commit
e4434e0f
.
parent
e4434e0f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
9 deletions
+7
-9
arguments.h
src/lxc/arguments.h
+1
-1
lxc_ls.c
src/lxc/lxc_ls.c
+6
-8
No files found.
src/lxc/arguments.h
View file @
adbc2d33
...
@@ -123,7 +123,7 @@ struct lxc_arguments {
...
@@ -123,7 +123,7 @@ struct lxc_arguments {
/* lxc-ls */
/* lxc-ls */
char
*
ls_fancy_format
;
char
*
ls_fancy_format
;
char
*
ls_groups
;
char
*
ls_groups
;
char
*
ls_
filter
;
char
*
ls_
regex
;
unsigned
int
ls_nesting
;
/* maximum allowed nesting level */
unsigned
int
ls_nesting
;
/* maximum allowed nesting level */
bool
ls_active
;
bool
ls_active
;
bool
ls_fancy
;
bool
ls_fancy
;
...
...
src/lxc/lxc_ls.c
View file @
adbc2d33
...
@@ -49,7 +49,6 @@ lxc_log_define(lxc_ls, lxc);
...
@@ -49,7 +49,6 @@ lxc_log_define(lxc_ls, lxc);
#define LS_ACTIVE 3
#define LS_ACTIVE 3
#define LS_RUNNING 4
#define LS_RUNNING 4
#define LS_NESTING 5
#define LS_NESTING 5
#define LS_FILTER 6
/* Store container info. */
/* Store container info. */
struct
ls
{
struct
ls
{
...
@@ -163,7 +162,7 @@ static const struct option my_longopts[] = {
...
@@ -163,7 +162,7 @@ static const struct option my_longopts[] = {
{
"stopped"
,
no_argument
,
0
,
LS_STOPPED
},
{
"stopped"
,
no_argument
,
0
,
LS_STOPPED
},
{
"nesting"
,
optional_argument
,
0
,
LS_NESTING
},
{
"nesting"
,
optional_argument
,
0
,
LS_NESTING
},
{
"groups"
,
required_argument
,
0
,
'g'
},
{
"groups"
,
required_argument
,
0
,
'g'
},
{
"
filter"
,
required_argument
,
0
,
LS_FILTER
},
{
"
regex"
,
required_argument
,
0
,
'r'
},
LXC_COMMON_OPTIONS
LXC_COMMON_OPTIONS
};
};
...
@@ -356,10 +355,9 @@ static int ls_get(struct ls **m, size_t *size, const struct lxc_arguments *args,
...
@@ -356,10 +355,9 @@ static int ls_get(struct ls **m, size_t *size, const struct lxc_arguments *args,
char
*
name
=
containers
[
i
];
char
*
name
=
containers
[
i
];
/* Filter container names by regex the user gave us. */
/* Filter container names by regex the user gave us. */
if
(
args
->
ls_
filter
||
args
->
argc
==
1
)
{
if
(
args
->
ls_
regex
)
{
regex_t
preg
;
regex_t
preg
;
tmp
=
args
->
ls_filter
?
args
->
ls_filter
:
args
->
argv
[
0
];
check
=
regcomp
(
&
preg
,
args
->
ls_regex
,
REG_NOSUB
|
REG_EXTENDED
);
check
=
regcomp
(
&
preg
,
tmp
,
REG_NOSUB
|
REG_EXTENDED
);
if
(
check
==
REG_ESPACE
)
/* we're out of memory */
if
(
check
==
REG_ESPACE
)
/* we're out of memory */
goto
out
;
goto
out
;
else
if
(
check
!=
0
)
else
if
(
check
!=
0
)
...
@@ -924,8 +922,8 @@ static int my_parser(struct lxc_arguments *args, int c, char *arg)
...
@@ -924,8 +922,8 @@ static int my_parser(struct lxc_arguments *args, int c, char *arg)
case
'g'
:
case
'g'
:
args
->
groups
=
arg
;
args
->
groups
=
arg
;
break
;
break
;
case
LS_FILTER
:
case
'r'
:
args
->
ls_
filter
=
arg
;
args
->
ls_
regex
=
arg
;
break
;
break
;
case
'F'
:
case
'F'
:
args
->
ls_fancy_format
=
arg
;
args
->
ls_fancy_format
=
arg
;
...
@@ -987,7 +985,7 @@ static int ls_remove_lock(const char *path, const char *name,
...
@@ -987,7 +985,7 @@ static int ls_remove_lock(const char *path, const char *name,
}
}
int
check
=
snprintf
(
*
lockpath
,
*
len_lockpath
,
"%s/lxc/lock/%s/%s"
,
RUNTIME_PATH
,
path
,
name
);
int
check
=
snprintf
(
*
lockpath
,
*
len_lockpath
,
"%s/lxc/lock/%s/%s"
,
RUNTIME_PATH
,
path
,
name
);
if
(
check
<
0
||
(
size_t
)
check
>=
*
len_lockpath
)
if
(
check
<
0
||
check
>=
*
len_lockpath
)
return
-
1
;
return
-
1
;
lxc_rmdir_onedev
(
*
lockpath
,
NULL
);
lxc_rmdir_onedev
(
*
lockpath
,
NULL
);
...
...
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