Commit ecc94d76 by Christian Brauner Committed by GitHub

Merge pull request #1860 from kilobyte/master

fix build failures on x32
parents 8c104d58 71460831
...@@ -1453,7 +1453,7 @@ static int set_config_prlimit(const char *key, const char *value, ...@@ -1453,7 +1453,7 @@ static int set_config_prlimit(const char *key, const char *value,
{ {
struct lxc_list *iter; struct lxc_list *iter;
struct rlimit limit; struct rlimit limit;
unsigned long limit_value; rlim_t limit_value;
struct lxc_list *limlist = NULL; struct lxc_list *limlist = NULL;
struct lxc_limit *limelem = NULL; struct lxc_limit *limelem = NULL;
......
...@@ -1081,7 +1081,7 @@ extern int set_config_limit(const char *key, const char *value, ...@@ -1081,7 +1081,7 @@ extern int set_config_limit(const char *key, const char *value,
{ {
struct lxc_list *iter; struct lxc_list *iter;
struct rlimit limit; struct rlimit limit;
unsigned long limit_value; rlim_t limit_value;
struct lxc_list *limlist = NULL; struct lxc_list *limlist = NULL;
struct lxc_limit *limelem = NULL; struct lxc_limit *limelem = NULL;
......
...@@ -672,7 +672,7 @@ int lxc_get_conf_int(struct lxc_conf *c, char *retv, int inlen, int v) ...@@ -672,7 +672,7 @@ int lxc_get_conf_int(struct lxc_conf *c, char *retv, int inlen, int v)
return snprintf(retv, inlen, "%d", v); return snprintf(retv, inlen, "%d", v);
} }
bool parse_limit_value(const char **value, unsigned long *res) bool parse_limit_value(const char **value, rlim_t *res)
{ {
char *endptr = NULL; char *endptr = NULL;
...@@ -683,7 +683,7 @@ bool parse_limit_value(const char **value, unsigned long *res) ...@@ -683,7 +683,7 @@ bool parse_limit_value(const char **value, unsigned long *res)
} }
errno = 0; errno = 0;
*res = strtoul(*value, &endptr, 10); *res = strtoull(*value, &endptr, 10);
if (errno || !endptr) if (errno || !endptr)
return false; return false;
*value = endptr; *value = endptr;
......
...@@ -84,5 +84,5 @@ extern void update_hwaddr(const char *line); ...@@ -84,5 +84,5 @@ extern void update_hwaddr(const char *line);
extern bool new_hwaddr(char *hwaddr); extern bool new_hwaddr(char *hwaddr);
extern int lxc_get_conf_str(char *retv, int inlen, const char *value); extern int lxc_get_conf_str(char *retv, int inlen, const char *value);
extern int lxc_get_conf_int(struct lxc_conf *c, char *retv, int inlen, int v); extern int lxc_get_conf_int(struct lxc_conf *c, char *retv, int inlen, int v);
extern bool parse_limit_value(const char **value, unsigned long *res); extern bool parse_limit_value(const char **value, rlim_t *res);
#endif /* __LXC_CONFILE_UTILS_H */ #endif /* __LXC_CONFILE_UTILS_H */
...@@ -222,7 +222,7 @@ int lxc_unix_epoch_to_utc(char *buf, size_t bufsize, const struct timespec *time ...@@ -222,7 +222,7 @@ int lxc_unix_epoch_to_utc(char *buf, size_t bufsize, const struct timespec *time
seconds = (time->tv_sec - d_in_s - h_in_s - (minutes * 60)); seconds = (time->tv_sec - d_in_s - h_in_s - (minutes * 60));
/* Make string from nanoseconds. */ /* Make string from nanoseconds. */
ret = snprintf(nanosec, LXC_NUMSTRLEN64, "%ld", time->tv_nsec); ret = snprintf(nanosec, LXC_NUMSTRLEN64, "%"PRId64, (int64_t)time->tv_nsec);
if (ret < 0 || ret >= LXC_NUMSTRLEN64) if (ret < 0 || ret >= LXC_NUMSTRLEN64)
return -1; return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment