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
240fecd0
Unverified
Commit
240fecd0
authored
Feb 18, 2019
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tree-wide: s/steal_fd/move_fd/g
Suggested-by:
Wolfgang Bumiller
<
w.bumiller@proxmox.com
>
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
e4edf5d7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
14 deletions
+14
-14
commands.c
src/lxc/commands.c
+7
-7
file_utils.c
src/lxc/file_utils.c
+2
-2
macro.h
src/lxc/macro.h
+5
-5
No files found.
src/lxc/commands.c
View file @
240fecd0
...
...
@@ -245,7 +245,7 @@ static int lxc_cmd_send(const char *name, struct lxc_cmd_rr *cmd,
return
-
1
;
if
(
cmd
->
req
.
datalen
<=
0
)
return
steal
_fd
(
client_fd
);
return
move
_fd
(
client_fd
);
errno
=
EMSGSIZE
;
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,
if
(
ret
<
0
||
ret
!=
(
ssize_t
)
cmd
->
req
.
datalen
)
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,
*
stopped
=
1
;
if
(
stay_connected
&&
ret
>
0
)
cmd
->
rsp
.
ret
=
steal
_fd
(
client_fd
);
cmd
->
rsp
.
ret
=
move
_fd
(
client_fd
);
return
ret
;
}
...
...
@@ -866,7 +866,7 @@ int lxc_cmd_add_state_client(const char *name, const char *lxcpath,
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
);
return
MAX_STATE
;
}
...
...
@@ -1184,7 +1184,7 @@ static int lxc_cmd_accept(int fd, uint32_t events, void *data,
return
ret
;
}
steal
_fd
(
connection
);
move
_fd
(
connection
);
return
ret
;
}
...
...
@@ -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
]);
return
steal
_fd
(
fd
);
return
move
_fd
(
fd
);
}
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
;
}
steal
_fd
(
fd
);
move
_fd
(
fd
);
return
ret
;
}
src/lxc/file_utils.c
View file @
240fecd0
...
...
@@ -234,13 +234,13 @@ int lxc_make_tmpfile(char *template, bool rm)
return
-
1
;
if
(
!
rm
)
return
steal
_fd
(
fd
);
return
move
_fd
(
fd
);
ret
=
unlink
(
template
);
if
(
ret
<
0
)
return
-
1
;
return
steal
_fd
(
fd
);
return
move
_fd
(
fd
);
}
bool
is_fs_type
(
const
struct
statfs
*
fs
,
fs_type_magic
magic_val
)
...
...
src/lxc/macro.h
View file @
240fecd0
...
...
@@ -400,11 +400,11 @@ enum {
__internal_ptr__; \
})
#define
steal_fd(fd)
\
({ \
int _
fd
_ = (fd); \
(fd) = -EBADF; \
_
fd
_; \
#define
move_fd(fd)
\
({
\
int _
_internal_fd_
_ = (fd); \
(fd) = -EBADF;
\
_
_internal_fd_
_; \
})
#endif
/* __LXC_MACRO_H */
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