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
b0f30508
Unverified
Commit
b0f30508
authored
Aug 31, 2018
by
Stéphane Graber
Committed by
GitHub
Aug 31, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2579 from brauner/2018-08-31/int64_t_pids
macro: calculate buffer lengths correctly
parents
f8db64b8
0c9b1f82
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
8 deletions
+27
-8
commands.c
src/lxc/commands.c
+3
-1
macro.h
src/lxc/macro.h
+24
-7
No files found.
src/lxc/commands.c
View file @
b0f30508
...
...
@@ -402,8 +402,10 @@ pid_t lxc_cmd_get_init_pid(const char *name, const char *lxcpath)
static
int
lxc_cmd_get_init_pid_callback
(
int
fd
,
struct
lxc_cmd_req
*
req
,
struct
lxc_handler
*
handler
)
{
intmax_t
pid
=
handler
->
pid
;
struct
lxc_cmd_rsp
rsp
=
{
.
data
=
INTMAX_TO_PTR
(
handler
->
pid
)
.
data
=
INTMAX_TO_PTR
(
pid
)
};
return
lxc_cmd_rsp_send
(
fd
,
&
rsp
);
...
...
src/lxc/macro.h
View file @
b0f30508
...
...
@@ -155,13 +155,30 @@
* +
* \0 = 1
*/
#define LXC_PROC_PID_FD_LEN (6 + INTTYPE_TO_STRLEN(pid_t) + 4 + INTTYPE_TO_STRLEN(int) + 1)
/* /proc/pid-to-str/status\0 = (5 + INTTYPE_TO_STRLEN(pid_t) + 7 + 1) */
#define LXC_PROC_STATUS_LEN (5 + INTTYPE_TO_STRLEN(pid_t) + 7 + 1)
/* /proc/pid-to-str/attr/current = (5 + INTTYPE_TO_STRLEN(pid_t) + 7 + 1) */
#define LXC_LSMATTRLEN (5 + INTTYPE_TO_STRLEN(pid_t) + 7 + 1)
#define LXC_PROC_PID_FD_LEN \
(6 + INTTYPE_TO_STRLEN(pid_t) + 4 + INTTYPE_TO_STRLEN(int) + 1)
/* /proc/ = 6
* +
* <pid-as-str> = INTTYPE_TO_STRLEN(pid_t)
* +
* /status = 7
* +
* \0 = 1
*/
#define LXC_PROC_STATUS_LEN (6 + INTTYPE_TO_STRLEN(pid_t) + 7 + 1)
/* /proc/ = 6
* +
* <pid-as-str> = INTTYPE_TO_STRLEN(pid_t)
* +
* /attr/ = 6
* +
* /current = 8
* +
* \0 = 1
*/
#define LXC_LSMATTRLEN (6 + INTTYPE_TO_STRLEN(pid_t) + 6 + 8 + 1)
#define LXC_CMD_DATA_MAX (MAXPATHLEN * 2)
...
...
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