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
cd1372e2
Unverified
Commit
cd1372e2
authored
Feb 18, 2019
by
Stéphane Graber
Committed by
GitHub
Feb 18, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2864 from brauner/2019-02-18/rename_pointer_macros
tree-wide: s/steal_{fd,ptr}/move_{fd,ptr}/g
parents
005f822b
240fecd0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
21 deletions
+21
-21
cgfsng.c
src/lxc/cgroups/cgfsng.c
+1
-1
commands.c
src/lxc/commands.c
+7
-7
file_utils.c
src/lxc/file_utils.c
+2
-2
macro.h
src/lxc/macro.h
+10
-10
rexec.c
src/lxc/rexec.c
+1
-1
No files found.
src/lxc/cgroups/cgfsng.c
View file @
cd1372e2
...
@@ -1451,7 +1451,7 @@ __cgfsng_ops static inline bool cgfsng_payload_create(struct cgroup_ops *ops,
...
@@ -1451,7 +1451,7 @@ __cgfsng_ops static inline bool cgfsng_payload_create(struct cgroup_ops *ops,
return
false
;
return
false
;
INFO
(
"The container process uses
\"
%s
\"
as cgroup"
,
container_cgroup
);
INFO
(
"The container process uses
\"
%s
\"
as cgroup"
,
container_cgroup
);
ops
->
container_cgroup
=
steal
_ptr
(
container_cgroup
);
ops
->
container_cgroup
=
move
_ptr
(
container_cgroup
);
return
true
;
return
true
;
}
}
...
...
src/lxc/commands.c
View file @
cd1372e2
...
@@ -245,7 +245,7 @@ static int lxc_cmd_send(const char *name, struct lxc_cmd_rr *cmd,
...
@@ -245,7 +245,7 @@ static int lxc_cmd_send(const char *name, struct lxc_cmd_rr *cmd,
return
-
1
;
return
-
1
;
if
(
cmd
->
req
.
datalen
<=
0
)
if
(
cmd
->
req
.
datalen
<=
0
)
return
steal
_fd
(
client_fd
);
return
move
_fd
(
client_fd
);
errno
=
EMSGSIZE
;
errno
=
EMSGSIZE
;
ret
=
lxc_send_nointr
(
client_fd
,
(
void
*
)
cmd
->
req
.
data
,
ret
=
lxc_send_nointr
(
client_fd
,
(
void
*
)
cmd
->
req
.
data
,
...
@@ -253,7 +253,7 @@ static int lxc_cmd_send(const char *name, struct lxc_cmd_rr *cmd,
...
@@ -253,7 +253,7 @@ static int lxc_cmd_send(const char *name, struct lxc_cmd_rr *cmd,
if
(
ret
<
0
||
ret
!=
(
ssize_t
)
cmd
->
req
.
datalen
)
if
(
ret
<
0
||
ret
!=
(
ssize_t
)
cmd
->
req
.
datalen
)
return
-
1
;
return
-
1
;
return
steal
_fd
(
client_fd
);
return
move
_fd
(
client_fd
);
}
}
/*
/*
...
@@ -304,7 +304,7 @@ static int lxc_cmd(const char *name, struct lxc_cmd_rr *cmd, int *stopped,
...
@@ -304,7 +304,7 @@ static int lxc_cmd(const char *name, struct lxc_cmd_rr *cmd, int *stopped,
*
stopped
=
1
;
*
stopped
=
1
;
if
(
stay_connected
&&
ret
>
0
)
if
(
stay_connected
&&
ret
>
0
)
cmd
->
rsp
.
ret
=
steal
_fd
(
client_fd
);
cmd
->
rsp
.
ret
=
move
_fd
(
client_fd
);
return
ret
;
return
ret
;
}
}
...
@@ -866,7 +866,7 @@ int lxc_cmd_add_state_client(const char *name, const char *lxcpath,
...
@@ -866,7 +866,7 @@ int lxc_cmd_add_state_client(const char *name, const char *lxcpath,
return
state
;
return
state
;
}
}
*
state_client_fd
=
steal
_fd
(
clientfd
);
*
state_client_fd
=
move
_fd
(
clientfd
);
TRACE
(
"Added state client %d to state client list"
,
*
state_client_fd
);
TRACE
(
"Added state client %d to state client list"
,
*
state_client_fd
);
return
MAX_STATE
;
return
MAX_STATE
;
}
}
...
@@ -1184,7 +1184,7 @@ static int lxc_cmd_accept(int fd, uint32_t events, void *data,
...
@@ -1184,7 +1184,7 @@ static int lxc_cmd_accept(int fd, uint32_t events, void *data,
return
ret
;
return
ret
;
}
}
steal
_fd
(
connection
);
move
_fd
(
connection
);
return
ret
;
return
ret
;
}
}
...
@@ -1214,7 +1214,7 @@ int lxc_cmd_init(const char *name, const char *lxcpath, const char *suffix)
...
@@ -1214,7 +1214,7 @@ int lxc_cmd_init(const char *name, const char *lxcpath, const char *suffix)
}
}
TRACE
(
"Created abstract unix socket
\"
%s
\"
"
,
&
path
[
1
]);
TRACE
(
"Created abstract unix socket
\"
%s
\"
"
,
&
path
[
1
]);
return
steal
_fd
(
fd
);
return
move
_fd
(
fd
);
}
}
int
lxc_cmd_mainloop_add
(
const
char
*
name
,
struct
lxc_epoll_descr
*
descr
,
int
lxc_cmd_mainloop_add
(
const
char
*
name
,
struct
lxc_epoll_descr
*
descr
,
...
@@ -1229,6 +1229,6 @@ int lxc_cmd_mainloop_add(const char *name, struct lxc_epoll_descr *descr,
...
@@ -1229,6 +1229,6 @@ int lxc_cmd_mainloop_add(const char *name, struct lxc_epoll_descr *descr,
return
ret
;
return
ret
;
}
}
steal
_fd
(
fd
);
move
_fd
(
fd
);
return
ret
;
return
ret
;
}
}
src/lxc/file_utils.c
View file @
cd1372e2
...
@@ -234,13 +234,13 @@ int lxc_make_tmpfile(char *template, bool rm)
...
@@ -234,13 +234,13 @@ int lxc_make_tmpfile(char *template, bool rm)
return
-
1
;
return
-
1
;
if
(
!
rm
)
if
(
!
rm
)
return
steal
_fd
(
fd
);
return
move
_fd
(
fd
);
ret
=
unlink
(
template
);
ret
=
unlink
(
template
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
-
1
;
return
-
1
;
return
steal
_fd
(
fd
);
return
move
_fd
(
fd
);
}
}
bool
is_fs_type
(
const
struct
statfs
*
fs
,
fs_type_magic
magic_val
)
bool
is_fs_type
(
const
struct
statfs
*
fs
,
fs_type_magic
magic_val
)
...
...
src/lxc/macro.h
View file @
cd1372e2
...
@@ -393,18 +393,18 @@ enum {
...
@@ -393,18 +393,18 @@ enum {
/* Maximum number of bytes sendfile() is able to send in one go. */
/* Maximum number of bytes sendfile() is able to send in one go. */
#define LXC_SENDFILE_MAX 0x7ffff000
#define LXC_SENDFILE_MAX 0x7ffff000
#define
steal_ptr(ptr)
\
#define
move_ptr(ptr)
\
({ \
({
\
typeof(ptr) _
ptr
_ = (ptr); \
typeof(ptr) _
_internal_ptr_
_ = (ptr); \
(ptr) = NULL; \
(ptr) = NULL;
\
_
ptr
_; \
_
_internal_ptr_
_; \
})
})
#define
steal_fd(fd)
\
#define
move_fd(fd)
\
({ \
({
\
int _
fd
_ = (fd); \
int _
_internal_fd_
_ = (fd); \
(fd) = -EBADF; \
(fd) = -EBADF;
\
_
fd
_; \
_
_internal_fd_
_; \
})
})
#endif
/* __LXC_MACRO_H */
#endif
/* __LXC_MACRO_H */
src/lxc/rexec.c
View file @
cd1372e2
...
@@ -77,7 +77,7 @@ static int parse_argv(char ***argv)
...
@@ -77,7 +77,7 @@ static int parse_argv(char ***argv)
if
(
ret
<=
0
)
if
(
ret
<=
0
)
return
-
1
;
return
-
1
;
steal
_ptr
(
cmdline
);
move
_ptr
(
cmdline
);
return
0
;
return
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