diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/address.c | 4 | ||||
-rw-r--r-- | src/common/compat.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/common/address.c b/src/common/address.c index c7483af09c..a9f731e9a2 100644 --- a/src/common/address.c +++ b/src/common/address.c @@ -64,7 +64,7 @@ tor_addr_to_sockaddr(const tor_addr_t *a, { if (a->family == AF_INET) { struct sockaddr_in *sin; - if (len < sizeof(struct sockaddr_in)) + if (len < (int)sizeof(struct sockaddr_in)) return -1; sin = (struct sockaddr_in *)sa_out; sin->sin_family = AF_INET; @@ -73,7 +73,7 @@ tor_addr_to_sockaddr(const tor_addr_t *a, return sizeof(struct sockaddr_in); } else if (a->family == AF_INET6) { struct sockaddr_in6 *sin6; - if (len < sizeof(struct sockaddr_in6)) + if (len < (int)sizeof(struct sockaddr_in6)) return -1; sin6 = (struct sockaddr_in6 *)sa_out; memset(sin6, 0, sizeof(struct sockaddr_in6)); diff --git a/src/common/compat.c b/src/common/compat.c index ded66493c5..31029844d1 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -497,7 +497,7 @@ tor_lockfile_lock(const char *filename, int blocking, int *locked_out) } #ifdef WIN32 _lseek(fd, 0, SEEK_SET); - if (_locking(fd, blocking ? _LK_LOCK : _LK_NBLOCK, 0) < 0) { + if (_locking(fd, blocking ? _LK_LOCK : _LK_NBLCK, 0) < 0) { if (errno != EDEADLOCK) log_warn(LD_FS,"Couldn't lock \"%s\": %s", filename, strerror(errno)); else @@ -529,8 +529,8 @@ tor_lockfile_unlock(tor_lockfile_t *lockfile) log_info(LD_FS, "Unlocking \"%s\"", lockfile->filename); #ifdef WIN32 - _lseek(fd, 0, SEEK_SET); - if (_locking(fd, _LK_UNLCK, 0) < 0) { + _lseek(lockfile->fd, 0, SEEK_SET); + if (_locking(lockfile->fd, _LK_UNLCK, 0) < 0) { log_warn(LD_FS,"Error unlocking \"%s\": %s", lockfile->filename, strerror(errno)); } |