diff options
author | Jameson Nash <vtjnash@gmail.com> | 2018-11-05 16:03:19 -0500 |
---|---|---|
committer | Jameson Nash <vtjnash@gmail.com> | 2018-11-29 11:21:44 -0500 |
commit | c5593b51dc98715f7f32a919301b5801ebf1a8ce (patch) | |
tree | 68083703aa316ca99eaf1ebd4e423ccf64dc9a57 /src/unix | |
parent | f1981d74ba880f010bfde6c98647bbb426a6d126 (diff) | |
download | libuv-c5593b51dc98715f7f32a919301b5801ebf1a8ce.tar.gz libuv-c5593b51dc98715f7f32a919301b5801ebf1a8ce.zip |
warnings: fix code that emits compiler warnings
PR-URL: https://github.com/libuv/libuv/pull/2066
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'src/unix')
-rw-r--r-- | src/unix/fs.c | 6 | ||||
-rw-r--r-- | src/unix/os390.c | 4 | ||||
-rw-r--r-- | src/unix/sunos.c | 3 |
3 files changed, 9 insertions, 4 deletions
diff --git a/src/unix/fs.c b/src/unix/fs.c index a2cfc3ae..d22c70f0 100644 --- a/src/unix/fs.c +++ b/src/unix/fs.c @@ -71,6 +71,10 @@ # include <utime.h> #endif +#if defined(_AIX) && _XOPEN_SOURCE <= 600 +extern char *mkdtemp(char *template); /* See issue #740 on AIX < 7 */ +#endif + #define INIT(subtype) \ do { \ if (req == NULL) \ @@ -723,7 +727,7 @@ static ssize_t uv__fs_utime(uv_fs_t* req) { atr.att_atimechg = 1; atr.att_mtime = req->mtime; atr.att_atime = req->atime; - return __lchattr(req->path, &atr, sizeof(atr)); + return __lchattr((char*) req->path, &atr, sizeof(atr)); #else errno = ENOSYS; return -1; diff --git a/src/unix/os390.c b/src/unix/os390.c index b43aebfc..c86036e9 100644 --- a/src/unix/os390.c +++ b/src/unix/os390.c @@ -229,8 +229,8 @@ static int getexe(const int pid, char* buf, size_t len) { assert(((Output_buf.Output_data.offsetPath >>24) & 0xFF) == 'A'); /* Get the offset from the lowest 3 bytes */ - Output_path = (char*)(&Output_buf) + - (Output_buf.Output_data.offsetPath & 0x00FFFFFF); + Output_path = (struct Output_path_type*) ((char*) (&Output_buf) + + (Output_buf.Output_data.offsetPath & 0x00FFFFFF)); if (Output_path->len >= len) { errno = ENOBUFS; diff --git a/src/unix/sunos.c b/src/unix/sunos.c index ec5ecd7d..2552a019 100644 --- a/src/unix/sunos.c +++ b/src/unix/sunos.c @@ -707,13 +707,14 @@ static int uv__set_phys_addr(uv_interface_address_t* address, struct sockaddr_dl* sa_addr; int sockfd; - int i; + size_t i; struct arpreq arpreq; /* This appears to only work as root */ sa_addr = (struct sockaddr_dl*)(ent->ifa_addr); memcpy(address->phys_addr, LLADDR(sa_addr), sizeof(address->phys_addr)); for (i = 0; i < sizeof(address->phys_addr); i++) { + /* Check that all bytes of phys_addr are zero. */ if (address->phys_addr[i] != 0) return 0; } |