mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-14 03:53:18 +00:00
tools: fix build warnings
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
12ae2a33c6
commit
09618fb8ab
@ -185,8 +185,9 @@ static int lxc_tool_monitord_spawn(const char *lxcpath)
|
|||||||
* synced with the child process. the if-empty-statement
|
* synced with the child process. the if-empty-statement
|
||||||
* construct is to quiet the warn-unused-result warning.
|
* construct is to quiet the warn-unused-result warning.
|
||||||
*/
|
*/
|
||||||
if (lxc_read_nointr(pipefd[0], &c, 1))
|
if (lxc_read_nointr(pipefd[0], &c, 1)) {
|
||||||
;
|
;
|
||||||
|
}
|
||||||
|
|
||||||
close(pipefd[0]);
|
close(pipefd[0]);
|
||||||
|
|
||||||
@ -207,7 +208,7 @@ static int lxc_tool_monitord_spawn(const char *lxcpath)
|
|||||||
close(pipefd[0]);
|
close(pipefd[0]);
|
||||||
|
|
||||||
ret = snprintf(pipefd_str, sizeof(pipefd_str), "%d", pipefd[1]);
|
ret = snprintf(pipefd_str, sizeof(pipefd_str), "%d", pipefd[1]);
|
||||||
if (ret < 0 || ret >= sizeof(pipefd_str)) {
|
if (ret < 0 || (size_t)ret >= sizeof(pipefd_str)) {
|
||||||
ERROR("Failed to create pid argument to pass to monitord");
|
ERROR("Failed to create pid argument to pass to monitord");
|
||||||
_exit(EXIT_FAILURE);
|
_exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
@ -149,14 +149,14 @@ static bool lookup_user(const char *oparg, uid_t *uid)
|
|||||||
struct passwd pwent;
|
struct passwd pwent;
|
||||||
struct passwd *pwentp = NULL;
|
struct passwd *pwentp = NULL;
|
||||||
char *buf;
|
char *buf;
|
||||||
size_t bufsize;
|
ssize_t bufsize;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!oparg || (oparg[0] == '\0'))
|
if (!oparg || (oparg[0] == '\0'))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
bufsize = sysconf(_SC_GETPW_R_SIZE_MAX);
|
bufsize = sysconf(_SC_GETPW_R_SIZE_MAX);
|
||||||
if (bufsize == -1)
|
if (bufsize < 0)
|
||||||
bufsize = 1024;
|
bufsize = 1024;
|
||||||
|
|
||||||
buf = malloc(bufsize);
|
buf = malloc(bufsize);
|
||||||
|
Loading…
Reference in New Issue
Block a user