diff options
Diffstat (limited to 'usr/src/lib/libc')
-rw-r--r-- | usr/src/lib/libc/i386/sys/gettimeofday.c | 5 | ||||
-rw-r--r-- | usr/src/lib/libc/port/gen/_ftoll.c | 6 | ||||
-rw-r--r-- | usr/src/lib/libc/port/gen/attrat.c | 2 | ||||
-rw-r--r-- | usr/src/lib/libc/port/gen/crypt.c | 22 | ||||
-rw-r--r-- | usr/src/lib/libc/port/gen/memset_s.c | 2 | ||||
-rw-r--r-- | usr/src/lib/libc/port/mapfile-vers | 6 | ||||
-rw-r--r-- | usr/src/lib/libc/port/sys/utimesys.c | 28 | ||||
-rw-r--r-- | usr/src/lib/libc/port/threads/rwlock.c | 5 |
8 files changed, 53 insertions, 23 deletions
diff --git a/usr/src/lib/libc/i386/sys/gettimeofday.c b/usr/src/lib/libc/i386/sys/gettimeofday.c index c2396e582a..a4c62aeb68 100644 --- a/usr/src/lib/libc/i386/sys/gettimeofday.c +++ b/usr/src/lib/libc/i386/sys/gettimeofday.c @@ -40,9 +40,10 @@ gettimeofday(struct timeval *tv, void *tz) * and layout of their members, the conversion can be done in-place. */ if (cp != NULL && __cp_can_gettime(cp) != 0) { - __cp_clock_gettime_realtime(cp, (struct timespec *)tv); + (void) __cp_clock_gettime_realtime(cp, (struct timespec *)tv); } else { - __clock_gettime_sys(CLOCK_REALTIME, (struct timespec *)tv); + (void) __clock_gettime_sys(CLOCK_REALTIME, + (struct timespec *)tv); } /* Convert from tv_nsec to tv_usec */ tv->tv_usec /= 1000; diff --git a/usr/src/lib/libc/port/gen/_ftoll.c b/usr/src/lib/libc/port/gen/_ftoll.c index 857a52b8a1..66d71f566c 100644 --- a/usr/src/lib/libc/port/gen/_ftoll.c +++ b/usr/src/lib/libc/port/gen/_ftoll.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "lint.h" #include <sys/isa_defs.h> #include <floatingpoint.h> @@ -104,7 +102,7 @@ __dtoll(double dval) default: if (exp > 30) { m1 = (m0 << (exp - 30)) | - (m1 >> (62 - exp)) & ~(-1 << (exp - 30)); + (m1 >> (62 - exp)) & ~(UINT_MAX << (exp - 30)); m0 >>= 62 - exp; } else { m1 = m0 >> (30 - exp); @@ -275,7 +273,7 @@ _Q_qtoll(long double longdbl) default: if (exp > 30) { m1 = (m0 << (exp - 30)) | - (m1 >> (62 - exp)) & ~(-1 << (exp - 30)); + (m1 >> (62 - exp)) & ~(UINT_MAX << (exp - 30)); m0 >>= 62 - exp; } else { m1 = m0 >> (30 - exp); diff --git a/usr/src/lib/libc/port/gen/attrat.c b/usr/src/lib/libc/port/gen/attrat.c index 89163a3909..d7c7949175 100644 --- a/usr/src/lib/libc/port/gen/attrat.c +++ b/usr/src/lib/libc/port/gen/attrat.c @@ -310,7 +310,7 @@ setattrat(int basefd, xattr_view_t view, const char *name, nvlist_t *request) void libc_nvlist_free(nvlist_t *nvp) { - nvfree(nvp); + (void) nvfree(nvp); } int diff --git a/usr/src/lib/libc/port/gen/crypt.c b/usr/src/lib/libc/port/gen/crypt.c index 5edc9a1deb..812062644f 100644 --- a/usr/src/lib/libc/port/gen/crypt.c +++ b/usr/src/lib/libc/port/gen/crypt.c @@ -208,10 +208,10 @@ cleanup: * either still allowed or not deprecated. * * RETURN VALUES - * Return a pointer to the new salt, the caller is responsible - * for using free(3c) on the return value. - * Returns NULL on error and sets errno to one of: - * EINVAL, ELIBACC, ENOMEM + * Return a pointer to the new salt, the caller is responsible + * for using free(3c) on the return value. + * Returns NULL on error and sets errno to one of: + * EINVAL, ELIBACC, ENOMEM */ char * crypt_gensalt(const char *oldsalt, const struct passwd *userinfo) @@ -570,7 +570,7 @@ getalgbyname(const char *algname, boolean_t *found) *found = B_TRUE; } } - if (!found) { + if (!(*found)) { errno = EINVAL; goto cleanup; } @@ -731,7 +731,7 @@ free_crypt_policy(struct crypt_policy_s *policy) /* * isa_path - prepend the default dir or patch up the $ISA in path - * Caller is responsible for calling free(3c) on the result. + * Caller is responsible for calling free(3c) on the result. */ static char * isa_path(const char *path) @@ -778,10 +778,10 @@ isa_path(const char *path) /*ARGSUSED*/ static char * _unix_crypt_gensalt(char *gsbuffer, - size_t gsbufflen, - const char *oldpuresalt, - const struct passwd *userinfo, - const char *argv[]) + size_t gsbufflen, + const char *oldpuresalt, + const struct passwd *userinfo, + const char *argv[]) { static const char saltchars[] = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; @@ -807,7 +807,7 @@ _unix_crypt_gensalt(char *gsbuffer, /* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ diff --git a/usr/src/lib/libc/port/gen/memset_s.c b/usr/src/lib/libc/port/gen/memset_s.c index c77b02de20..f1f0d732e9 100644 --- a/usr/src/lib/libc/port/gen/memset_s.c +++ b/usr/src/lib/libc/port/gen/memset_s.c @@ -63,7 +63,7 @@ memset_s(void *s, rsize_t smax, int c, rsize_t n) * memset() called through a volatile pointer to guarantee * it will not be optimized away. */ - (*__memset_vp)(s, v, lim); + (void) (*__memset_vp)(s, v, lim); if (n > RSIZE_MAX) { __throw_constraint_handler_s("memset_s: n > RSIZE_MAX", diff --git a/usr/src/lib/libc/port/mapfile-vers b/usr/src/lib/libc/port/mapfile-vers index 29af604724..cd5543d872 100644 --- a/usr/src/lib/libc/port/mapfile-vers +++ b/usr/src/lib/libc/port/mapfile-vers @@ -78,6 +78,12 @@ $if _x86 && _ELF64 $add amd64 $endif +SYMBOL_VERSION ILLUMOS_0.34 { + protected: + futimes; + lutimes; +} ILLUMOS_0.33; + SYMBOL_VERSION ILLUMOS_0.33 { protected: c16rtomb; diff --git a/usr/src/lib/libc/port/sys/utimesys.c b/usr/src/lib/libc/port/sys/utimesys.c index dc917f27ae..55e53dbb53 100644 --- a/usr/src/lib/libc/port/sys/utimesys.c +++ b/usr/src/lib/libc/port/sys/utimesys.c @@ -24,6 +24,10 @@ * Use is subject to license terms. */ +/* + * Copyright 2020 OmniOS Community Edition (OmniOSce) Association. + */ + #include "lint.h" #include <string.h> #include <utime.h> @@ -67,8 +71,8 @@ utime(const char *path, const struct utimbuf *times) return (utimensat(AT_FDCWD, path, tsp, 0)); } -int -utimes(const char *path, const struct timeval times[2]) +static int +utimes_impl(const char *path, const struct timeval times[2], int flag) { struct timeval ltimes[2]; timespec_t ts[2]; @@ -86,7 +90,19 @@ utimes(const char *path, const struct timeval times[2]) ts[1].tv_nsec = ltimes[1].tv_usec * 1000; tsp = ts; } - return (utimensat(AT_FDCWD, path, tsp, 0)); + return (utimensat(AT_FDCWD, path, tsp, flag)); +} + +int +utimes(const char *path, const struct timeval times[2]) +{ + return (utimes_impl(path, times, 0)); +} + +int +lutimes(const char *path, const struct timeval times[2]) +{ + return (utimes_impl(path, times, AT_SYMLINK_NOFOLLOW)); } #pragma weak _futimesat = futimesat @@ -115,3 +131,9 @@ futimesat(int fd, const char *path, const struct timeval times[2]) return (utimensat(fd, path, tsp, 0)); } + +int +futimes(int fd, const struct timeval times[2]) +{ + return (futimesat(fd, NULL, times)); +} diff --git a/usr/src/lib/libc/port/threads/rwlock.c b/usr/src/lib/libc/port/threads/rwlock.c index 9654b7daaf..faff5da953 100644 --- a/usr/src/lib/libc/port/threads/rwlock.c +++ b/usr/src/lib/libc/port/threads/rwlock.c @@ -505,7 +505,6 @@ shared_rwlock_lock(rwlock_t *rwlp, timespec_t *tsp, int rd_wr) { volatile uint32_t *rwstate = (volatile uint32_t *)&rwlp->rwlock_readers; mutex_t *mp = &rwlp->mutex; - uint32_t readers; int try_flag; int error; @@ -536,8 +535,12 @@ shared_rwlock_lock(rwlock_t *rwlp, timespec_t *tsp, int rd_wr) } } atomic_or_32(rwstate, URW_HAS_WAITERS); + +#ifdef THREAD_DEBUG + uint32_t readers; readers = *rwstate; ASSERT_CONSISTENT_STATE(readers); +#endif /* * The calls to __lwp_rwlock_*() below will release the mutex, * so we need a dtrace probe here. The owner field of the |