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
51a8a74c
Unverified
Commit
51a8a74c
authored
Feb 08, 2019
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coccinelle: s/while({1,true})/for(;;)/
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
99dc3a33
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
24 additions
and
12 deletions
+24
-12
while-true.cocci
coccinelle/while-true.cocci
+12
-0
lxc_init.c
src/lxc/cmd/lxc_init.c
+1
-1
lxccontainer.c
src/lxc/lxccontainer.c
+2
-2
network.c
src/lxc/network.c
+1
-1
pam_cgfs.c
src/lxc/pam/pam_cgfs.c
+2
-2
btrfs.c
src/lxc/storage/btrfs.c
+1
-1
nbd.c
src/lxc/storage/nbd.c
+1
-1
string_utils.c
src/lxc/string_utils.c
+2
-2
arguments.c
src/lxc/tools/arguments.c
+1
-1
utils.c
src/lxc/utils.c
+1
-1
No files found.
coccinelle/while-true.cocci
0 → 100644
View file @
51a8a74c
@@
statement s;
@@
- while (true)
+ for (;;)
s
@@
statement s;
@@
- while (1)
+ for (;;)
s
src/lxc/cmd/lxc_init.c
View file @
51a8a74c
...
...
@@ -492,7 +492,7 @@ See the lxc-init man page for further information.\n\n");
static
int
arguments_parse
(
struct
arguments
*
args
,
int
argc
,
char
*
const
argv
[])
{
while
(
true
)
{
for
(;;
)
{
int
c
;
int
index
=
0
;
...
...
src/lxc/lxccontainer.c
View file @
51a8a74c
...
...
@@ -3365,7 +3365,7 @@ static int copy_file(const char *old, const char *new)
return
-
1
;
}
while
(
1
)
{
for
(;;
)
{
len
=
lxc_read_nointr
(
in
,
buf
,
8096
);
if
(
len
<
0
)
{
SYSERROR
(
"Error reading old file %s"
,
old
);
...
...
@@ -4100,7 +4100,7 @@ static int get_next_index(const char *lxcpath, char *cname)
fname
=
must_realloc
(
NULL
,
strlen
(
lxcpath
)
+
20
);
while
(
1
)
{
for
(;;
)
{
sprintf
(
fname
,
"%s/snap%d"
,
lxcpath
,
i
);
ret
=
stat
(
fname
,
&
sb
);
...
...
src/lxc/network.c
View file @
51a8a74c
...
...
@@ -1974,7 +1974,7 @@ char *lxc_mkifname(char *template)
}
/* Generate random names until we find one that doesn't exist. */
while
(
true
)
{
for
(;;
)
{
name
[
0
]
=
'\0'
;
(
void
)
strlcpy
(
name
,
template
,
IFNAMSIZ
);
...
...
src/lxc/pam/pam_cgfs.c
View file @
51a8a74c
...
...
@@ -259,7 +259,7 @@ static bool mkdir_parent(const char *root, char *path)
return
true
;
b
=
path
+
strlen
(
root
)
+
1
;
while
(
true
)
{
for
(;;
)
{
while
(
*
b
&&
(
*
b
==
'/'
))
b
++
;
if
(
!*
b
)
...
...
@@ -878,7 +878,7 @@ static char *cgv1_get_current_cgroup(char *basecginfo, char *controller)
p
=
basecginfo
;
while
(
true
)
{
for
(;;
)
{
p
=
strchr
(
p
,
':'
);
if
(
!
p
)
return
NULL
;
...
...
src/lxc/storage/btrfs.c
View file @
51a8a74c
...
...
@@ -805,7 +805,7 @@ static int btrfs_recursive_destroy(const char *path)
sk
->
max_transid
=
(
u64
)
-
1
;
sk
->
nr_items
=
4096
;
while
(
1
)
{
for
(;;
)
{
ret
=
ioctl
(
fd
,
BTRFS_IOC_TREE_SEARCH
,
&
args
);
e
=
errno
;
if
(
ret
<
0
)
{
...
...
src/lxc/storage/nbd.c
View file @
51a8a74c
...
...
@@ -72,7 +72,7 @@ bool attach_nbd(char *src, struct lxc_conf *conf)
if
(
p
)
*
p
=
'\0'
;
while
(
1
)
{
for
(;;
)
{
sprintf
(
path
,
"/dev/nbd%d"
,
i
);
if
(
!
file_exists
(
path
))
...
...
src/lxc/string_utils.c
View file @
51a8a74c
...
...
@@ -69,7 +69,7 @@ char **lxc_va_arg_list_to_argv(va_list ap, size_t skip, int do_strdup)
* constantly...
*/
va_copy
(
ap2
,
ap
);
while
(
1
)
{
for
(;;
)
{
char
*
arg
=
va_arg
(
ap2
,
char
*
);
if
(
!
arg
)
break
;
...
...
@@ -82,7 +82,7 @@ char **lxc_va_arg_list_to_argv(va_list ap, size_t skip, int do_strdup)
return
NULL
;
count
=
skip
;
while
(
1
)
{
for
(;;
)
{
char
*
arg
=
va_arg
(
ap
,
char
*
);
if
(
!
arg
)
break
;
...
...
src/lxc/tools/arguments.c
View file @
51a8a74c
...
...
@@ -207,7 +207,7 @@ extern int lxc_arguments_parse(struct lxc_arguments *args, int argc,
return
ret
;
}
while
(
true
)
{
for
(;;
)
{
int
c
;
int
index
=
0
;
...
...
src/lxc/utils.c
View file @
51a8a74c
...
...
@@ -1101,7 +1101,7 @@ static int open_without_symlink(const char *target, const char *prefix_skip)
goto
out
;
}
while
(
1
)
{
for
(;;
)
{
int
newfd
,
saved_errno
;
char
*
nextpath
;
...
...
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