diff options
Diffstat (limited to 'usr/src/lib')
37 files changed, 665 insertions, 572 deletions
diff --git a/usr/src/lib/libbc/libc/sys/common/uname.c b/usr/src/lib/libbc/libc/sys/common/uname.c index ef09e18f63..ca035f85c7 100644 --- a/usr/src/lib/libbc/libc/sys/common/uname.c +++ b/usr/src/lib/libbc/libc/sys/common/uname.c @@ -24,23 +24,21 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <errno.h> #include <string.h> #include <sys/utsname.h> #include <sys/syscall.h> -/* +/* * utsname structure has a different format in SVr4/SunOS 5.0. * The data needs to be mapped before returning to the user. */ -/* +/* * The following values and structure are from the SVR4 utsname.h. */ #define NEW_SYS_NMLN 257 -#define SYS_NMLN 9 +#define SYS_NMLN 9 #define SYS_NDLN 65 struct n_utsname { @@ -51,14 +49,14 @@ struct n_utsname { char machine[NEW_SYS_NMLN]; }; -int uname( uts ) -register struct utsname *uts; /* where to put results */ +int +uname(struct utsname *uts) { - return(bc_uname(uts)); + return (bc_uname(uts)); } -int bc_uname( uts ) -struct utsname *uts; +int +bc_uname(struct utsname *uts) { struct n_utsname n_uts; int ret; @@ -67,9 +65,13 @@ struct utsname *uts; memcpy(uts->sysname, n_uts.sysname, SYS_NMLN); if (strlen(n_uts.sysname) > SYS_NMLN) uts->sysname[SYS_NMLN-1] = '\0'; - memcpy(uts->nodename, n_uts.nodename, SYS_NDLN); - if (strlen(n_uts.nodename) > SYS_NDLN) - uts->nodename[SYS_NDLN-1] = '\0'; + + memcpy(uts->nodename, n_uts.nodename, SYS_NMLN); + memcpy(uts->nodeext, n_uts.nodename + SYS_NMLN, + SYS_NDLN - SYS_NMLN); + if (strlen(n_uts.nodename + SYS_NMLN) > SYS_NDLN - SYS_NMLN) + uts->nodeext[SYS_NDLN - SYS_NMLN - 1] = '\0'; + memcpy(uts->release, n_uts.release, SYS_NMLN); if (strlen(n_uts.release) > SYS_NMLN) uts->release[SYS_NMLN-1] = '\0'; @@ -81,5 +83,5 @@ struct utsname *uts; uts->machine[SYS_NMLN-1] = '\0'; } - return(ret); + return (ret); } diff --git a/usr/src/lib/libc/Makefile b/usr/src/lib/libc/Makefile index b75390cbcc..93934954dd 100644 --- a/usr/src/lib/libc/Makefile +++ b/usr/src/lib/libc/Makefile @@ -127,7 +127,7 @@ $(ROOTVARIANTDIR64)/$(VAR1_DYNLIB64) := FILEMODE= 755 .KEEP_STATE: -all: lib32 $(BUILD64) .WAIT lib64 .WAIT etc THIRDPARTYLICENSE +all: all_h lib32 $(BUILD64) .WAIT lib64 .WAIT etc THIRDPARTYLICENSE THIRDPARTYLICENSE: extract-copyright $(RM) $@ diff --git a/usr/src/lib/libc/inc/base_inlines.h b/usr/src/lib/libc/inc/base_inlines.h index 1753a3e044..c9bf36a90c 100644 --- a/usr/src/lib/libc/inc/base_inlines.h +++ b/usr/src/lib/libc/inc/base_inlines.h @@ -27,8 +27,7 @@ #ifndef _BASE_INLINES_H #define _BASE_INLINES_H -#pragma ident "%Z%%M% %I% %E% SMI" - +#include <sys/ccompile.h> #include <sys/types.h> #if !defined(__lint) && defined(__GNUC__) @@ -41,7 +40,7 @@ */ #if defined(__sparc) -extern __inline__ double +extern __GNU_INLINE double __mul_set(double x, double y, int *pe) { double __result; @@ -49,19 +48,19 @@ __mul_set(double x, double y, int *pe) uint32_t *__addr = &__fsr; __asm__ __volatile__( - "fmuld %4, %5, %0\n\t" - "st %%fsr, %3\n\t" - "ld %3, %2\n\t" - "and %2, 1, %2\n\t" - "st %2, %1" - : "=&e" (__result), "=m" (*pe), "=r" (__fsr), "=m" (*__addr) - : "e" (x), "e" (y)); + "fmuld %4, %5, %0\n\t" + "st %%fsr, %3\n\t" + "ld %3, %2\n\t" + "and %2, 1, %2\n\t" + "st %2, %1" + : "=&e" (__result), "=m" (*pe), "=r" (__fsr), "=m" (*__addr) + : "e" (x), "e" (y)); return (__result); } #endif /* __sparc */ #if defined(__sparc) -extern __inline__ double +extern __GNU_INLINE double __div_set(double x, double y, int *pe) { double __result; @@ -69,37 +68,37 @@ __div_set(double x, double y, int *pe) uint32_t *__addr = &__fsr; __asm__ __volatile__( - "fdivd %4, %5, %0\n\t" - "st %%fsr, %3\n\t" - "ld %3, %2\n\t" - "and %2, 1, %2\n\t" - "st %2, %1" - : "=&e" (__result), "=m" (*pe), "=r" (__fsr), "=m" (*__addr) - : "e" (x), "e" (y)); + "fdivd %4, %5, %0\n\t" + "st %%fsr, %3\n\t" + "ld %3, %2\n\t" + "and %2, 1, %2\n\t" + "st %2, %1" + : "=&e" (__result), "=m" (*pe), "=r" (__fsr), "=m" (*__addr) + : "e" (x), "e" (y)); return (__result); } #endif /* __sparc */ #if defined(__sparc) -extern __inline__ double +extern __GNU_INLINE double __dabs(double *x) { double __result; __asm__ __volatile__( #if defined(__sparcv9) - "fabsd %1, %0" + "fabsd %1, %0" #else - "fabss %1, %0" + "fabss %1, %0" #endif - : "=e" (__result) - : "0" (*x)); + : "=e" (__result) + : "0" (*x)); return (__result); } #endif /* __sparc */ #if defined(__sparc) -extern __inline__ void +extern __GNU_INLINE void __get_ieee_flags(__ieee_flags_type *b) { uint32_t __fsr; @@ -109,16 +108,16 @@ __get_ieee_flags(__ieee_flags_type *b) * needed; however, it warns as it does so. Add them here for now. */ __asm__ __volatile__( - "st %%fsr, %0\n\t" - "st %%g0, %1\n\t" - "ld %1, %%fsr\n\t" - "nop; nop; nop" - : "=m" (*b), "=m" (__fsr)); + "st %%fsr, %0\n\t" + "st %%g0, %1\n\t" + "ld %1, %%fsr\n\t" + "nop; nop; nop" + : "=m" (*b), "=m" (__fsr)); } #endif /* __sparc */ #if defined(__sparc) -extern __inline__ void +extern __GNU_INLINE void __set_ieee_flags(__ieee_flags_type *b) { /* @@ -126,10 +125,10 @@ __set_ieee_flags(__ieee_flags_type *b) * needed; however, it warns as it does so. Add them here for now. */ __asm__ __volatile__( - "ld %0, %%fsr\n\t" - "nop; nop; nop" - : /* no outputs */ - : "m" (*b)); + "ld %0, %%fsr\n\t" + "nop; nop; nop" + : /* no outputs */ + : "m" (*b)); } #endif /* __sparc */ diff --git a/usr/src/lib/libc/inc/thr_inlines.h b/usr/src/lib/libc/inc/thr_inlines.h index 55bd645428..7376109aa5 100644 --- a/usr/src/lib/libc/inc/thr_inlines.h +++ b/usr/src/lib/libc/inc/thr_inlines.h @@ -27,54 +27,56 @@ #ifndef _THR_INLINES_H #define _THR_INLINES_H -#pragma ident "%Z%%M% %I% %E% SMI" +#include <sys/ccompile.h> #if !defined(__lint) && defined(__GNUC__) /* inlines for gcc */ -extern __inline__ ulwp_t * +extern __GNU_INLINE ulwp_t * _curthread(void) { -#if defined(__amd64) ulwp_t *__value; - __asm__ __volatile__("movq %%fs:0, %0" : "=r" (__value)); + __asm__ __volatile__( +#if defined(__amd64) + "movq %%fs:0, %0\n\t" #elif defined(__i386) - ulwp_t *__value; - __asm__ __volatile__("movl %%gs:0, %0" : "=r" (__value)); + "movl %%gs:0, %0\n\t" #elif defined(__sparc) - register ulwp_t *__value __asm__("g7"); + ".register %%g7, #scratch\n\t" + "mov %%g7, %0\n\t" #else #error "port me" #endif + : "=r" (__value)); return (__value); } -extern __inline__ ulwp_t * +extern __GNU_INLINE ulwp_t * __curthread(void) { ulwp_t *__value; __asm__ __volatile__( #if defined(__amd64) - "movq %%fs:0, %0\n\t" + "movq %%fs:0, %0\n\t" #elif defined(__i386) - "movl %%gs:0, %0\n\t" + "movl %%gs:0, %0\n\t" #elif defined(__sparcv9) - ".register %%g7, #scratch\n\t" - "ldx [%%g7 + 80], %0\n\t" + ".register %%g7, #scratch\n\t" + "ldx [%%g7 + 80], %0\n\t" #elif defined(__sparc) - ".register %%g7, #scratch\n\t" - "ld [%%g7 + 80], %0\n\t" + ".register %%g7, #scratch\n\t" + "ld [%%g7 + 80], %0\n\t" #else #error "port me" #endif - "1:" - : "=r" (__value) - : : "cc"); + "1:" + : "=r" (__value) + : : "cc"); return (__value); } -extern __inline__ greg_t +extern __GNU_INLINE greg_t stkptr(void) { #if defined(__amd64) @@ -89,207 +91,207 @@ stkptr(void) return (__value); } -extern __inline__ hrtime_t +extern __GNU_INLINE hrtime_t gethrtime(void) /* note: caller-saved registers are trashed */ { #if defined(__amd64) hrtime_t __value; __asm__ __volatile__( - "movl $3, %%eax\n\t" - "int $0xd2" - : "=a" (__value) - : : "rcx", "rdx", "rsi", "rdi", "r8", "r9", "r10", "r11", "cc"); + "movl $3, %%eax\n\t" + "int $0xd2" + : "=a" (__value) + : : "rcx", "rdx", "rsi", "rdi", "r8", "r9", "r10", "r11", "cc"); #elif defined(__i386) hrtime_t __value; __asm__ __volatile__( - "movl $3, %%eax\n\t" - "int $0xd2" - : "=A" (__value) - : : "ecx", "cc"); + "movl $3, %%eax\n\t" + "int $0xd2" + : "=A" (__value) + : : "ecx", "cc"); #elif defined(__sparcv9) register hrtime_t __value __asm__("o0"); __asm__ __volatile__( - "ta 0x24\n\t" - "sllx %%o0, 32, %0\n\t" - "or %%o1, %0, %0" - : "=r" (__value) - : : "o1", "o2", "o3", "o4", "o5", "cc"); + "ta 0x24\n\t" + "sllx %%o0, 32, %0\n\t" + "or %%o1, %0, %0" + : "=r" (__value) + : : "o1", "o2", "o3", "o4", "o5", "cc"); #elif defined(__sparc) register hrtime_t __value __asm__("o0"); __asm__ __volatile__( - "ta 0x24" - : "=r" (__value) - : : "o2", "o3", "o4", "o5", "cc"); + "ta 0x24" + : "=r" (__value) + : : "o2", "o3", "o4", "o5", "cc"); #else #error "port me" #endif return (__value); } -extern __inline__ int +extern __GNU_INLINE int set_lock_byte(volatile uint8_t *__lockp) { int __value; #if defined(__x86) __asm__ __volatile__( - "movl $1, %0\n\t" - "xchgb %%dl, %1" - : "+d" (__value), "+m" (*__lockp)); + "movl $1, %0\n\t" + "xchgb %%dl, %1" + : "+d" (__value), "+m" (*__lockp)); #elif defined(__sparc) __asm__ __volatile__( - "ldstub %1, %0\n\t" - "membar #LoadLoad" - : "=r" (__value), "+m" (*__lockp)); + "ldstub %1, %0\n\t" + "membar #LoadLoad" + : "=r" (__value), "+m" (*__lockp)); #else #error "port me" #endif return (__value); } -extern __inline__ uint32_t +extern __GNU_INLINE uint32_t atomic_swap_32(volatile uint32_t *__memory, uint32_t __value) { #if defined(__x86) __asm__ __volatile__( - "xchgl %0, %1" - : "+q" (__value), "+m" (*__memory)); + "xchgl %0, %1" + : "+q" (__value), "+m" (*__memory)); return (__value); #elif defined(__sparc) uint32_t __tmp1, __tmp2; __asm__ __volatile__( - "ld [%3], %0\n\t" - "1:\n\t" - "mov %4, %1\n\t" - "cas [%3], %0, %1\n\t" - "cmp %0, %1\n\t" - "bne,a,pn %%icc, 1b\n\t" - " mov %1, %0" - : "=&r" (__tmp1), "=&r" (__tmp2), "=m" (*__memory) - : "r" (__memory), "r" (__value) - : "cc"); + "ld [%3], %0\n\t" + "1:\n\t" + "mov %4, %1\n\t" + "cas [%3], %0, %1\n\t" + "cmp %0, %1\n\t" + "bne,a,pn %%icc, 1b\n\t" + " mov %1, %0" + : "=&r" (__tmp1), "=&r" (__tmp2), "=m" (*__memory) + : "r" (__memory), "r" (__value) + : "cc"); return (__tmp2); #else #error "port me" #endif } -extern __inline__ uint32_t +extern __GNU_INLINE uint32_t atomic_cas_32(volatile uint32_t *__memory, uint32_t __cmp, uint32_t __newvalue) { uint32_t __oldvalue; #if defined(__x86) __asm__ __volatile__( - "lock; cmpxchgl %3, %0" - : "=m" (*__memory), "=a" (__oldvalue) - : "a" (__cmp), "r" (__newvalue)); + "lock; cmpxchgl %3, %0" + : "=m" (*__memory), "=a" (__oldvalue) + : "a" (__cmp), "r" (__newvalue)); #elif defined(__sparc) __asm__ __volatile__( - "cas [%2], %3, %1" - : "=m" (*__memory), "=&r" (__oldvalue) - : "r" (__memory), "r" (__cmp), "1" (__newvalue)); + "cas [%2], %3, %1" + : "=m" (*__memory), "=&r" (__oldvalue) + : "r" (__memory), "r" (__cmp), "1" (__newvalue)); #else #error "port me" #endif return (__oldvalue); } -extern __inline__ void +extern __GNU_INLINE void atomic_inc_32(volatile uint32_t *__memory) { #if defined(__x86) __asm__ __volatile__( - "lock; incl %0" - : "+m" (*__memory)); + "lock; incl %0" + : "+m" (*__memory)); #elif defined(__sparc) uint32_t __tmp1, __tmp2; __asm__ __volatile__( - "ld [%3], %0\n\t" - "1:\n\t" - "add %0, 1, %1\n\t" - "cas [%3], %0, %1\n\t" - "cmp %0, %1\n\t" - "bne,a,pn %%icc, 1b\n\t" - " mov %1, %0" - : "=&r" (__tmp1), "=&r" (__tmp2), "=m" (*__memory) - : "r" (__memory) - : "cc"); + "ld [%3], %0\n\t" + "1:\n\t" + "add %0, 1, %1\n\t" + "cas [%3], %0, %1\n\t" + "cmp %0, %1\n\t" + "bne,a,pn %%icc, 1b\n\t" + " mov %1, %0" + : "=&r" (__tmp1), "=&r" (__tmp2), "=m" (*__memory) + : "r" (__memory) + : "cc"); #else #error "port me" #endif } -extern __inline__ void +extern __GNU_INLINE void atomic_dec_32(volatile uint32_t *__memory) { #if defined(__x86) __asm__ __volatile__( - "lock; decl %0" - : "+m" (*__memory)); + "lock; decl %0" + : "+m" (*__memory)); #elif defined(__sparc) uint32_t __tmp1, __tmp2; __asm__ __volatile__( - "ld [%3], %0\n\t" - "1:\n\t" - "sub %0, 1, %1\n\t" - "cas [%3], %0, %1\n\t" - "cmp %0, %1\n\t" - "bne,a,pn %%icc, 1b\n\t" - " mov %1, %0" - : "=&r" (__tmp1), "=&r" (__tmp2), "=m" (*__memory) - : "r" (__memory) - : "cc"); + "ld [%3], %0\n\t" + "1:\n\t" + "sub %0, 1, %1\n\t" + "cas [%3], %0, %1\n\t" + "cmp %0, %1\n\t" + "bne,a,pn %%icc, 1b\n\t" + " mov %1, %0" + : "=&r" (__tmp1), "=&r" (__tmp2), "=m" (*__memory) + : "r" (__memory) + : "cc"); #else #error "port me" #endif } -extern __inline__ void +extern __GNU_INLINE void atomic_and_32(volatile uint32_t *__memory, uint32_t __bits) { #if defined(__x86) __asm__ __volatile__( - "lock; andl %1, %0" - : "+m" (*__memory) - : "r" (__bits)); + "lock; andl %1, %0" + : "+m" (*__memory) + : "r" (__bits)); #elif defined(__sparc) uint32_t __tmp1, __tmp2; __asm__ __volatile__( - "ld [%3], %0\n\t" - "1:\n\t" - "and %0, %4, %1\n\t" - "cas [%3], %0, %1\n\t" - "cmp %0, %1\n\t" - "bne,a,pn %%icc, 1b\n\t" - " mov %1, %0" - : "=&r" (__tmp1), "=&r" (__tmp2), "=m" (*__memory) - : "r" (__memory), "r" (__bits) - : "cc"); + "ld [%3], %0\n\t" + "1:\n\t" + "and %0, %4, %1\n\t" + "cas [%3], %0, %1\n\t" + "cmp %0, %1\n\t" + "bne,a,pn %%icc, 1b\n\t" + " mov %1, %0" + : "=&r" (__tmp1), "=&r" (__tmp2), "=m" (*__memory) + : "r" (__memory), "r" (__bits) + : "cc"); #else #error "port me" #endif } -extern __inline__ void +extern __GNU_INLINE void atomic_or_32(volatile uint32_t *__memory, uint32_t __bits) { #if defined(__x86) __asm__ __volatile__( - "lock; orl %1, %0" - : "+m" (*__memory) - : "r" (__bits)); + "lock; orl %1, %0" + : "+m" (*__memory) + : "r" (__bits)); #elif defined(__sparc) uint32_t __tmp1, __tmp2; __asm__ __volatile__( - "ld [%3], %0\n\t" - "1:\n\t" - "or %0, %4, %1\n\t" - "cas [%3], %0, %1\n\t" - "cmp %0, %1\n\t" - "bne,a,pn %%icc, 1b\n\t" - " mov %1, %0" - : "=&r" (__tmp1), "=&r" (__tmp2), "=m" (*__memory) - : "r" (__memory), "r" (__bits) - : "cc"); + "ld [%3], %0\n\t" + "1:\n\t" + "or %0, %4, %1\n\t" + "cas [%3], %0, %1\n\t" + "cmp %0, %1\n\t" + "bne,a,pn %%icc, 1b\n\t" + " mov %1, %0" + : "=&r" (__tmp1), "=&r" (__tmp2), "=m" (*__memory) + : "r" (__memory), "r" (__bits) + : "cc"); #else #error "port me" #endif @@ -297,14 +299,14 @@ atomic_or_32(volatile uint32_t *__memory, uint32_t __bits) #if defined(__sparc) /* only needed on sparc */ -extern __inline__ ulong_t +extern __GNU_INLINE ulong_t caller(void) { register ulong_t __value __asm__("i7"); return (__value); } -extern __inline__ ulong_t +extern __GNU_INLINE ulong_t getfp(void) { register ulong_t __value __asm__("fp"); @@ -315,7 +317,7 @@ getfp(void) #if defined(__x86) /* only needed on x86 */ -extern __inline__ void +extern __GNU_INLINE void ht_pause(void) { __asm__ __volatile__("rep; nop"); diff --git a/usr/src/lib/libc/port/fp/floatundidf.c b/usr/src/lib/libc/port/fp/floatundidf.c new file mode 100644 index 0000000000..276c1b12c7 --- /dev/null +++ b/usr/src/lib/libc/port/fp/floatundidf.c @@ -0,0 +1,47 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include "quadint.h" + +#pragma weak __floatundidf = ___floatundidf + +/* + * Convert an unsigned longlong_t to a double-precision floating point value. + */ +double +___floatundidf(u_longlong_t a) +{ + union uu aa; + double d; + + aa.q = a; + d = aa.ul[H]; + d *= (1 << HALF_BITS); + d *= (1 << HALF_BITS); + d += aa.ul[L]; + + return (d); +} diff --git a/usr/src/lib/libc/port/fp/floatundisf.c b/usr/src/lib/libc/port/fp/floatundisf.c new file mode 100644 index 0000000000..0afb7f8e88 --- /dev/null +++ b/usr/src/lib/libc/port/fp/floatundisf.c @@ -0,0 +1,47 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#include "quadint.h" + +#pragma weak __floatundisf = ___floatundisf + +/* + * Convert an unsigned longlong_t to a single-precision floating point value. + */ +float +___floatundisf(u_longlong_t a) +{ + union uu aa; + double d; + + aa.q = a; + d = aa.ul[H]; + d *= (1 << HALF_BITS); + d *= (1 << HALF_BITS); + d += aa.ul[L]; + + return ((float)d); +} diff --git a/usr/src/lib/libc/port/mapfile-vers b/usr/src/lib/libc/port/mapfile-vers index 59999885a5..c2313fc09e 100644 --- a/usr/src/lib/libc/port/mapfile-vers +++ b/usr/src/lib/libc/port/mapfile-vers @@ -2984,6 +2984,8 @@ $if sparc32 __cmpdi2; __floatdidf; __floatdisf; + __floatundidf; + __floatundisf; __lshrdi3; __muldi3; __ucmpdi2; diff --git a/usr/src/lib/libc/sparc/Makefile.com b/usr/src/lib/libc/sparc/Makefile.com index 045b78ba86..97aa14a7d6 100644 --- a/usr/src/lib/libc/sparc/Makefile.com +++ b/usr/src/lib/libc/sparc/Makefile.com @@ -372,6 +372,8 @@ PORTFP= \ divdi3.o \ floatdidf.o \ floatdisf.o \ + floatundidf.o \ + floatundisf.o \ lshrdi3.o \ moddi3.o \ muldi3.o \ @@ -1202,8 +1204,9 @@ TIL= \ $(TIL:%=pics/%) := CFLAGS += $(LIBCBASE)/threads/sparc.il -# This hack is needed until the sparc gcc is fixed for TLS -pics/tls_data.o := CC = env 'CW_NO_SHADOW=1' $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc +# This hack is needed because sparc GCC3 generates DWARF data about TLS which +# The Sun assembler cannot process +$(__GNUC3)pics/tls_data.o := CC = env 'CW_NO_SHADOW=1' $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc # special kludge for inlines with 'cas': pics/rwlock.o pics/synch.o pics/lwp.o pics/door_calls.o := \ diff --git a/usr/src/lib/libc/sparc/crt/_rtld.c b/usr/src/lib/libc/sparc/crt/_rtld.c index 132aad09c0..caa2919674 100644 --- a/usr/src/lib/libc/sparc/crt/_rtld.c +++ b/usr/src/lib/libc/sparc/crt/_rtld.c @@ -62,6 +62,15 @@ #define SYSCONFIG (*(funcs[SYSCONFIG_F])) /* + * GCC will not emit unused static functions unless specifically told it must + */ +#ifdef __GNUC__ +#define __USED __attribute__((used)) +#else +#define __USED +#endif + +/* * Alias ld.so entry point -- receives a bootstrap structure and a vector * of strings. The vector is "well-known" to us, and consists of pointers * to string constants. This aliasing bootstrap requires no relocation in @@ -70,7 +79,7 @@ * order to maintain the "no bootstrapping" requirement -- it calls only * local functions, uses no intrinsics, etc. */ -static void * +static void * __USED __rtld(Elf32_Boot *ebp, const char *strings[], int (*funcs[])()) { int i, p; /* working */ diff --git a/usr/src/lib/libc/sparcv9/Makefile.com b/usr/src/lib/libc/sparcv9/Makefile.com index 226547fa6d..462d07e8a2 100644 --- a/usr/src/lib/libc/sparcv9/Makefile.com +++ b/usr/src/lib/libc/sparcv9/Makefile.com @@ -1136,8 +1136,9 @@ TIL= \ $(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/sparcv9.il -# This hack is needed until the sparc gcc is fixed for TLS -pics/tls_data.o := CC = env 'CW_NO_SHADOW=1' $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc +# This hack is needed because sparc GCC3 generates DWARF data about TLS which +# The Sun assembler cannot process +$(__GNUC3)pics/tls_data.o := CC = env 'CW_NO_SHADOW=1' $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc # Files in fp, port/fp subdirectories that need base.il inline template IL= \ diff --git a/usr/src/lib/libc_db/common/thread_db.c b/usr/src/lib/libc_db/common/thread_db.c index 78989e1152..77c44b2782 100644 --- a/usr/src/lib/libc_db/common/thread_db.c +++ b/usr/src/lib/libc_db/common/thread_db.c @@ -824,7 +824,8 @@ __td_ta_tsd_iter(td_thragent_t *ta_p, td_key_iter_f *cb, void *cbdata_p) else { for (key = 1; key < numkeys; key++) { destruct32 = destructors32[key]; - if (destruct32 != (caddr32_t)TSD_UNALLOCATED && + if ((destruct32 != + (caddr32_t)(uintptr_t)TSD_UNALLOCATED) && (*cb)(key, (PFrV)(uintptr_t)destruct32, cbdata_p)) break; diff --git a/usr/src/lib/libctf/common/mapfile-vers b/usr/src/lib/libctf/common/mapfile-vers index c218edc37c..031748c497 100644 --- a/usr/src/lib/libctf/common/mapfile-vers +++ b/usr/src/lib/libctf/common/mapfile-vers @@ -68,6 +68,7 @@ SYMBOL_VERSION SUNWprivate_1.2 { ctf_member_info; ctf_parent_file; ctf_parent_name; + ctf_parent_label; ctf_set_array; ctf_type_align; ctf_type_cmp; diff --git a/usr/src/lib/libdns_sd/java/com/apple/dnssd/DNSSDRecordRegistrar.java b/usr/src/lib/libdns_sd/java/com/apple/dnssd/DNSSDRecordRegistrar.java index 366d83476b..6983e279fa 100644 --- a/usr/src/lib/libdns_sd/java/com/apple/dnssd/DNSSDRecordRegistrar.java +++ b/usr/src/lib/libdns_sd/java/com/apple/dnssd/DNSSDRecordRegistrar.java @@ -5,9 +5,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -25,9 +25,6 @@ Re-licensed mDNSResponder daemon source code under Apache License, Version 2.0 Revision 1.1 2006/06/20 23:00:12 rpantos <rdar://problem/3839132> Java needs to implement DNSServiceRegisterRecord equivalent - -ident "%Z%%M% %I% %E% SMI" - */ @@ -38,7 +35,7 @@ package com.apple.dnssd; public interface DNSSDRecordRegistrar extends DNSSDService { - /** Register an independent {@link DNSRecord}.<P> + /** Register an independent {@link DNSRecord}.<P> @param flags Possible values are SHARED or UNIQUE (see flag type definitions for details). <P> @@ -55,25 +52,22 @@ public interface DNSSDRecordRegistrar extends DNSSDService as defined in nameser.h. <P> @param rrclass - The class of the resource record, as defined in nameser.h + The class of the resource record, as defined in nameser.h (usually 1 for the Internet class). <P> - @param rData + @param rdata The new rdata as it is to appear in the DNS record. <P> @param ttl The time to live of the resource record, in seconds. Pass 0 to use a default value. <P> - @param listener - This object will get called when the service is registered. - <P> @return A {@link DNSSDService} that can be used to abort the record registration. @throws SecurityException If a security manager is present and denies <tt>RuntimePermission("getDNSSDInstance")</tt>. @see RuntimePermission */ - public DNSRecord registerRecord( int flags, int ifIndex, String fullname, int rrtype, + public DNSRecord registerRecord( int flags, int ifIndex, String fullname, int rrtype, int rrclass, byte[] rdata, int ttl) throws DNSSDException; -} +} diff --git a/usr/src/lib/libdtrace/common/dt_module.c b/usr/src/lib/libdtrace/common/dt_module.c index 1490f775c3..c74fb527a0 100644 --- a/usr/src/lib/libdtrace/common/dt_module.c +++ b/usr/src/lib/libdtrace/common/dt_module.c @@ -646,6 +646,17 @@ dt_module_getctf(dtrace_hdl_t *dtp, dt_module_t *dmp) goto err; } + /* + * If the label we claim the parent must have does not match + * its actual topmost label (XXX: Should check all?), ignore + * the CTF entirely rather than acquiring possibly bad type + * references. + */ + if (strcmp(ctf_label_topmost(pfp), ctf_parent_label(dmp->dm_ctfp)) != 0) { + (void) dt_set_errno(dtp, EDT_NOCTF); + goto err; + } + if (ctf_import(dmp->dm_ctfp, pfp) == CTF_ERR) { dtp->dt_ctferr = ctf_errno(dmp->dm_ctfp); (void) dt_set_errno(dtp, EDT_CTF); diff --git a/usr/src/lib/libkmsagent/Makefile.com b/usr/src/lib/libkmsagent/Makefile.com index cba1111887..4b1fe9dd12 100644 --- a/usr/src/lib/libkmsagent/Makefile.com +++ b/usr/src/lib/libkmsagent/Makefile.com @@ -85,8 +85,7 @@ CCOBJS = $(LIB_CPP_OBJECTS:%.o=pics/%.o) \ LIBS = $(DYNLIB) -CCNEEDED = -lCstd -lCrun -$(__GNUC)CCNEEDED = -L$(SFWLIBDIR) -R$(SFWLIBDIR) -lstdc++ -lgcc_s +$(__SUNC)CCNEEDED = -lCstd -lCrun LDLIBS += $(CCNEEDED) -lpam -lc -lsoftcrypto -lcrypto -lssl -lsocket LDLIBS64 += $(CCNEEDED) -lpam -lc -lsoftcrypto -lcrypto -lssl -lsocket diff --git a/usr/src/lib/libkmsagent/amd64/Makefile b/usr/src/lib/libkmsagent/amd64/Makefile index 1268f351e4..c1ec486658 100644 --- a/usr/src/lib/libkmsagent/amd64/Makefile +++ b/usr/src/lib/libkmsagent/amd64/Makefile @@ -31,13 +31,6 @@ include $(SRC)/lib/Makefile.lib.64 # CCNEEDED must be modified for 64-bit because the default only includes # -lCrun # -CCNEEDED = -lCstd -lCrun - -# -# If linking with gcc, we must fix the CCNEEDED and LDLIBS64 -# to get a clean link without duplicates. -# -$(__GNUC)CCNEEDED = -L$(SFWLIBDIR) -R$(SFWLIBDIR) -lstdc++ -lgcc_s -$(__GNUC)LDLIBS64 += $(CCNEEDED) +$(__SUNC)CCNEEDED = -lCstd -lCrun install: all $(ROOTLIBS64) $(ROOTLINKS64) diff --git a/usr/src/lib/libkmsagent/common/KMSAgent.cpp b/usr/src/lib/libkmsagent/common/KMSAgent.cpp index 3d34ea571f..bb95e737c6 100644 --- a/usr/src/lib/libkmsagent/common/KMSAgent.cpp +++ b/usr/src/lib/libkmsagent/common/KMSAgent.cpp @@ -1518,8 +1518,9 @@ KMS_AGENT_STATUS KMSAgent_CreateKey ( CAutoMutex oAutoMutex((K_MUTEX_HANDLE) i_pProfile->m_pLock); struct KMS_Agent::KMS_Agent__DataUnit - stDataUnit = {"", "", "", "", - (KMS_Agent::KMS_Agent__DataUnitState) 0}; + stDataUnit = {(char *)"", (char *)"", (char *)"", + (char *)"", + (KMS_Agent::KMS_Agent__DataUnitState) 0}; struct soap *pstSoap = (struct soap *) i_pProfile->m_pvSoap; struct KMS_Agent::KMS_Agent__CreateKeyResponse oResponse; @@ -2120,7 +2121,8 @@ KMS_AGENT_STATUS KMSAgent_DisassociateDataUnitKeys ( CAutoMutex oAutoMutex((K_MUTEX_HANDLE) i_pProfile->m_pLock); - struct KMS_Agent::KMS_Agent__DataUnit stDataUnit = {"", "", "", "", + struct KMS_Agent::KMS_Agent__DataUnit stDataUnit = {(char *)"", + (char *)"", (char *)"", (char *)"", (KMS_Agent::KMS_Agent__DataUnitState) 0}; struct soap *pstSoap = (struct soap *) i_pProfile->m_pvSoap; @@ -2262,7 +2264,8 @@ KMS_AGENT_STATUS KMSAgent_RetrieveKey ( RETURN(KMS_AGENT_STATUS_INVALID_PARAMETER); } - struct KMS_Agent::KMS_Agent__DataUnit stDataUnit = {"", "", "", "", + struct KMS_Agent::KMS_Agent__DataUnit stDataUnit = { + (char *)"", (char *)"", (char *)"", (char *)"", (KMS_Agent::KMS_Agent__DataUnitState) 0}; struct soap *pstSoap = (struct soap *) i_pProfile->m_pvSoap; @@ -3146,7 +3149,8 @@ KMS_AGENT_STATUS KMSAgent_RetrieveDataUnitKeys ( // prepare args to soap transaction - struct KMS_Agent::KMS_Agent__DataUnit stDataUnit = {"", "", "", "", + struct KMS_Agent::KMS_Agent__DataUnit stDataUnit = { + (char *)"", (char *)"", (char *)"", (char *)"", (KMS_Agent::KMS_Agent__DataUnitState) 0}; struct soap *pstSoap = (struct soap *) i_pProfile->m_pvSoap; @@ -3380,7 +3384,8 @@ KMS_AGENT_STATUS KMSAgent_RetrieveProtectAndProcessKey ( CAutoMutex oAutoMutex((K_MUTEX_HANDLE) i_pProfile->m_pLock); - struct KMS_Agent::KMS_Agent__DataUnit stDataUnit ={"", "", "", "", + struct KMS_Agent::KMS_Agent__DataUnit stDataUnit = { + (char *)"", (char *)"", (char *)"", (char *)"", (KMS_Agent::KMS_Agent__DataUnitState) 0}; struct soap *pstSoap = (struct soap *) i_pProfile->m_pvSoap; diff --git a/usr/src/lib/libkmsagent/sparcv9/Makefile b/usr/src/lib/libkmsagent/sparcv9/Makefile index 1268f351e4..c1ec486658 100644 --- a/usr/src/lib/libkmsagent/sparcv9/Makefile +++ b/usr/src/lib/libkmsagent/sparcv9/Makefile @@ -31,13 +31,6 @@ include $(SRC)/lib/Makefile.lib.64 # CCNEEDED must be modified for 64-bit because the default only includes # -lCrun # -CCNEEDED = -lCstd -lCrun - -# -# If linking with gcc, we must fix the CCNEEDED and LDLIBS64 -# to get a clean link without duplicates. -# -$(__GNUC)CCNEEDED = -L$(SFWLIBDIR) -R$(SFWLIBDIR) -lstdc++ -lgcc_s -$(__GNUC)LDLIBS64 += $(CCNEEDED) +$(__SUNC)CCNEEDED = -lCstd -lCrun install: all $(ROOTLIBS64) $(ROOTLINKS64) diff --git a/usr/src/lib/libnisdb/db_dictionary.cc b/usr/src/lib/libnisdb/db_dictionary.cc index d618529a28..a642bb3f09 100644 --- a/usr/src/lib/libnisdb/db_dictionary.cc +++ b/usr/src/lib/libnisdb/db_dictionary.cc @@ -26,8 +26,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "db_headers.h" #include "db_entry.h" #include "db_dictionary.h" @@ -1509,7 +1507,7 @@ db_dictionary::find_table(char *tab, db_table_desc **where, db *res; int lstat; db_status dstat; - char *myself = "db_dictionary::find_table"; + const char *myself = "db_dictionary::find_table"; res = find_table_noLDAP(tab, where, searchDeferred, doLoad); /* If found, or shouldn't try LDAP, we're done */ @@ -1992,9 +1990,9 @@ DECLMUTEXLOCK(db_standby_list); static int close_standby_list() { - db *database; - int i, ret; - char *myself = "close_standby_list"; + db *database; + int i, ret; + const char *myself = "close_standby_list"; MUTEXLOCK(db_standby_list, "close_standby_list"); @@ -2046,8 +2044,8 @@ close_standby_list() int add_to_standby_list(db* database) { - int i; - char *myself = "add_to_standby_list"; + int i; + const char *myself = "add_to_standby_list"; MUTEXLOCK(db_standby_list, "add_to_standby_list"); @@ -2239,7 +2237,7 @@ db_dictionary::defer(char *table) { WRITELOCK(this, DB_LOCK_ERROR, "w db_dictionary::defer"); db_table_desc *tbl = find_table_desc(table); int res; - char *myself = "db_dictionary::defer"; + const char *myself = "db_dictionary::defer"; if (tbl != NULL) { db_table_desc *clone, *savenext = tbl->next; diff --git a/usr/src/lib/libnisdb/db_mindex.cc b/usr/src/lib/libnisdb/db_mindex.cc index 9feb47045e..c3e8c22ea7 100644 --- a/usr/src/lib/libnisdb/db_mindex.cc +++ b/usr/src/lib/libnisdb/db_mindex.cc @@ -924,7 +924,7 @@ db_mindex::add(db_query *q, entry_object * obj) bool_t valid; db_index_entry *rp = NULL; db_status rstat; - char *myself = "db_mindex::add"; + const char *myself = "db_mindex::add"; /* * The argument q is only NULL when we know that there are diff --git a/usr/src/lib/libnisdb/db_mindex2.cc b/usr/src/lib/libnisdb/db_mindex2.cc index eb2553d7eb..bf3d8a82ee 100644 --- a/usr/src/lib/libnisdb/db_mindex2.cc +++ b/usr/src/lib/libnisdb/db_mindex2.cc @@ -149,9 +149,9 @@ extern void db_free_result(db_result *); zotypes updateMappingObj(__nis_table_mapping_t *t, char **objNameP, bool_t *isMasterP) { - zotypes type = NIS_BOGUS_OBJ; - char *objName = 0; - char *myself = "updateMappingObj"; + zotypes type = NIS_BOGUS_OBJ; + char *objName = 0; + const char *myself = "updateMappingObj"; if (t != 0) objName = t->objName; @@ -216,7 +216,7 @@ mappingFromObj(nis_object *obj, int *statP) { __nis_table_mapping_t *t; __nis_buffer_t b = {0, 0}; char *objPath; - char *myself = "mappingFromObj"; + const char *myself = "mappingFromObj"; if (obj == 0 || obj->zo_data.zo_type == NIS_ENTRY_OBJ) return (0); @@ -252,7 +252,7 @@ selectMapping(db_table *table, nis_object *obj, db_query *qin, bool_t doLDAP, asObj; int stat = LDAP_SUCCESS; char *objPath = 0, buf[MAXPATHLEN+NIS_MAXNAMELEN+1]; - char *myself = "db_mindex::selectMapping"; + const char *myself = "db_mindex::selectMapping"; /* * If 'table' is NULL, we try to find a mapping for 'obj'. @@ -454,7 +454,7 @@ db_mindex::updateTableEntry(entry_object *e, int replace, char *tableName, db_result *dbres; db_query *qi; nis_object *oldObj = 0; - char *myself = "db_mindex::updateTableEntry"; + const char *myself = "db_mindex::updateTableEntry"; if (table == 0 || e == 0) return (LDAP_PARAM_ERROR); @@ -688,7 +688,7 @@ static __nis_table_mapping_t * findDirEntryMapping(__nis_table_mapping_t *t, entry_object *e, char **name) { __nis_table_mapping_t *x; char *entryName; - char *myself = "findDirEntryMapping"; + const char *myself = "findDirEntryMapping"; __nis_buffer_t b = {0, 0}; if (e == 0 || e->en_cols.en_cols_len != 2 || @@ -735,7 +735,7 @@ db_mindex::queryLDAP(db_query *qin, char *dbId, int doAsynch) { nis_attr attr; nis_object *dirObj; db_status dstat; - char *myself = "db_mindex::queryLDAP"; + const char *myself = "db_mindex::queryLDAP"; if (!useLDAPrespository || table == 0) return (LDAP_SUCCESS); @@ -1173,7 +1173,7 @@ db_mindex::storeObjLDAP(__nis_table_mapping_t *t, nis_object *o) { int numEa, doUnlock = 0; db *dbase = 0; db_mindex *dbm = 0; - char *myself = "db_mindex::storeObjLDAP"; + const char *myself = "db_mindex::storeObjLDAP"; if (t == 0 || o == 0) return (LDAP_SUCCESS); @@ -1287,7 +1287,7 @@ db_mindex::storeLDAP(db_query *qin, entry_object *obj, nis_object *o, db_query *q, *qo, **qa; __nis_rule_value_t *rv = 0; int stat; - char *myself = "db_mindex::storeLDAP"; + const char *myself = "db_mindex::storeLDAP"; if (!useLDAPrespository || table == 0) return (LDAP_SUCCESS); diff --git a/usr/src/lib/libnisdb/db_mindex3.cc b/usr/src/lib/libnisdb/db_mindex3.cc index 85c63c40d8..2c4485576c 100644 --- a/usr/src/lib/libnisdb/db_mindex3.cc +++ b/usr/src/lib/libnisdb/db_mindex3.cc @@ -99,7 +99,7 @@ db_mindex::entriesFromLDAP(__nis_table_mapping_t *t, db_query *qin, db_query *q, __entries_from_ldap_arg_t *arg; int stat; db_status dstat; - char *myself = "db_mindex::entriesFromLDAP"; + const char *myself = "db_mindex::entriesFromLDAP"; arg = (__entries_from_ldap_arg_t *)am(myself, sizeof (*arg)); if (arg == 0) { @@ -282,7 +282,7 @@ entriesFromLDAPthread(void *voidarg) { /* Lock to prevent removal */ (void) __nis_lock_db_table(arg->tableName, 1, 0, - "entriesFromLDAPthread"); + (char *)"entriesFromLDAPthread"); /* * It's possible that the db_mindex for the table has changed, @@ -314,7 +314,7 @@ entriesFromLDAPthread(void *voidarg) { stat = entriesFromLDAPreal(arg); (void) __nis_ulock_db_table(arg->tableName, 1, 0, - "entriesFromLDAPthread"); + (char *)"entriesFromLDAPthread"); freeQuery(arg->q); if (arg->dirObj != 0) @@ -343,7 +343,7 @@ entriesFromLDAPreal(__entries_from_ldap_arg_t *arg) { bool_t doEnum; db_status dstat; struct timeval start; - char *myself = + const char *myself = "db_mindex::entriesFromLDAPreal"; if (arg == 0) @@ -708,9 +708,9 @@ entriesFromLDAPreal(__entries_from_ldap_arg_t *arg) { o.zo_ttl = to->zo_ttl; } else { tc = 0; - o.zo_owner = ""; - o.zo_group = ""; - o.zo_domain = ""; + o.zo_owner = (char *)""; + o.zo_group = (char *)""; + o.zo_domain = (char *)""; } o.zo_data.zo_type = NIS_ENTRY_OBJ; diff --git a/usr/src/lib/libnisdb/db_table.cc b/usr/src/lib/libnisdb/db_table.cc index 8ac3bf0c3f..29710d6d10 100644 --- a/usr/src/lib/libnisdb/db_table.cc +++ b/usr/src/lib/libnisdb/db_table.cc @@ -26,8 +26,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdio.h> #include <malloc.h> #include <string.h> @@ -398,7 +396,7 @@ db_table::allocateExpire(long oldSize, long newSize) { db_status db_table::allocateEnumArray(long oldSize, long newSize) { entry_object **newEnumArray; - char *myself = "db_table::allocateEnumArray"; + char *myself = (char *)"db_table::allocateEnumArray"; if (enumCount.flag > 0) { if (enumIndex.ptr == 0) { @@ -558,7 +556,7 @@ db_table::get_entry(entryp where) void db_table::setEntryExp(entryp where, entry_obj *obj, int initialLoad) { nis_object *o; - char *myself = "db_table::setEntryExp"; + char *myself = (char *)"db_table::setEntryExp"; /* * If we don't know what type of object this is yet, we @@ -601,7 +599,7 @@ db_table::setEntryExp(entryp where, entry_obj *obj, int initialLoad) { if (o != 0) { __nis_buffer_t b = {0, 0}; - bp2buf(myself, &b, "%s.%s", + bp2buf(myself, &b, (char *)"%s.%s", o->zo_name, o->zo_domain); t = getObjMapping(b.buf, 0, 1, 0, 0); sfree(b.buf); @@ -766,7 +764,7 @@ bool_t db_table::configure(char *tablePath) { long i; struct timeval now; - char *myself = "db_table::configure"; + char *myself = (char *)"db_table::configure"; (void) gettimeofday(&now, NULL); @@ -951,7 +949,7 @@ db_table::dupEntry(entry_object *obj, entryp loc) { */ void db_table::setEnumMode(long enumNum) { - char *myself = "setEnumMode"; + const char *myself = "setEnumMode"; enumMode.flag++; if (enumMode.flag == 1) { @@ -969,7 +967,7 @@ db_table::setEnumMode(long enumNum) { if (stat != DB_SUCCESS) { enumMode.flag = 0; enumCount.flag = 0; - logmsg(MSG_NOTIMECHECK, LOG_ERR, + logmsg(MSG_NOTIMECHECK, LOG_ERR, (char *) "%s: No memory for enum check array; entry removal disabled", myself); } diff --git a/usr/src/lib/libnisdb/ldap_glob.c b/usr/src/lib/libnisdb/ldap_glob.c index e422336b77..7943ec685f 100644 --- a/usr/src/lib/libnisdb/ldap_glob.c +++ b/usr/src/lib/libnisdb/ldap_glob.c @@ -24,8 +24,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ldap_glob.h" /* These are the local versions we use if the app doesn't provide overrides */ @@ -71,12 +69,12 @@ __local_addUpdate(log_entry_t type, char *name, int numAttr, nis_attr *attr, } int -__local_lockTransLog(char *msg, int wr, int trylock) { +__local_lockTransLog(const char *msg, int wr, int trylock) { return (0); } void -__local_unlockTransLog(char *msg, int wr) { +__local_unlockTransLog(const char *msg, int wr) { } int diff --git a/usr/src/lib/libnisdb/ldap_glob.h b/usr/src/lib/libnisdb/ldap_glob.h index 38a2ed67c2..3f6ca0288b 100644 --- a/usr/src/lib/libnisdb/ldap_glob.h +++ b/usr/src/lib/libnisdb/ldap_glob.h @@ -24,8 +24,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #ifndef _LDAP_GLOB_H #define _LDAP_GLOB_H @@ -61,8 +59,8 @@ extern int endTransaction(int xid, nis_object *dirObj); extern int addUpdate(log_entry_t type, char *name, int numAttr, nis_attr *attr, nis_object *obj, nis_object *oldDir, uint32_t ttime); -extern int lockTransLog(char *msg, int wr, int trylock); -extern void unlockTransLog(char *msg, int wr); +extern int lockTransLog(const char *msg, int wr, int trylock); +extern void unlockTransLog(const char *msg, int wr); extern int __nis_lock_db_table(nis_name name, int readwrite, int *trylock, char *msg); extern int __nis_ulock_db_table(nis_name name, int readwrite, diff --git a/usr/src/lib/libnisdb/ldap_util.c b/usr/src/lib/libnisdb/ldap_util.c index 9dfc04085f..6fc00d7493 100644 --- a/usr/src/lib/libnisdb/ldap_util.c +++ b/usr/src/lib/libnisdb/ldap_util.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdio.h> #include <stdlib.h> #include <strings.h> @@ -49,7 +47,7 @@ static pthread_key_t tsdKey; * Log a message to the appropriate place. */ void -logmsg(int msgtype, int priority, char *fmt, ...) { +logmsg(int msgtype, int priority, const char *fmt, ...) { va_list ap; struct timeval tp; @@ -199,7 +197,7 @@ logError(int priority) { * zero bytes is legal, and returns a NULL pointer. */ void * -am(char *msg, int size) { +am(const char *msg, int size) { void *p; if (size > 0) { @@ -227,7 +225,7 @@ am(char *msg, int size) { * on a NULL pointer. */ int -slen(char *str) { +slen(const char *str) { return ((str != 0) ? strlen(str) : 0); } @@ -236,7 +234,7 @@ slen(char *str) { * like strdup(), but don't die if 'str' is a NULL pointer. */ char * -sdup(char *msg, int allocate, char *str) { +sdup(const char *msg, int allocate, char *str) { char *s; if (!allocate) @@ -259,7 +257,7 @@ sdup(char *msg, int allocate, char *str) { * NULL pointer or two. If deallocate!=0, free() the input strings. */ char * -scat(char *msg, int deallocate, char *s1, char *s2) { +scat(const char *msg, int deallocate, char *s1, char *s2) { char *n; int l1 = 0, l2 = 0; @@ -437,7 +435,7 @@ scasecmp(char *s, __nis_single_value_t *v) { * result to '*buf'. */ int -vp2buf(char *msg, char **buf, int buflen, char *fmt, va_list ap) { +vp2buf(const char *msg, char **buf, int buflen, const char *fmt, va_list ap) { char *newbuf = am(msg, STDBUFSIZE); int size = 0; @@ -482,7 +480,7 @@ p2buf(char *msg, char *fmt, ...) { /* sprintf to the specified __nis_buffer_t */ void -bp2buf(char *msg, __nis_buffer_t *b, char *fmt, ...) { +bp2buf(const char *msg, __nis_buffer_t *b, const char *fmt, ...) { va_list ap; va_start(ap, fmt); @@ -492,7 +490,7 @@ bp2buf(char *msg, __nis_buffer_t *b, char *fmt, ...) { /* Copy 'buf' to the specified __nis_buffer_t */ void -bc2buf(char *msg, void *buf, int len, __nis_buffer_t *b) { +bc2buf(const char *msg, void *buf, int len, __nis_buffer_t *b) { void *new; /* @@ -517,7 +515,7 @@ bc2buf(char *msg, void *buf, int len, __nis_buffer_t *b) { /* Like bc2buf(), but remove any trailing NUL bytes */ void -sbc2buf(char *msg, void *buf, int len, __nis_buffer_t *b) { +sbc2buf(const char *msg, void *buf, int len, __nis_buffer_t *b) { if (buf == 0 || len <= 0 || b == 0) return; /* Snip off trailing NULs */ diff --git a/usr/src/lib/libnisdb/ldap_util.h b/usr/src/lib/libnisdb/ldap_util.h index 9f72f8f46b..4df2439f31 100644 --- a/usr/src/lib/libnisdb/ldap_util.h +++ b/usr/src/lib/libnisdb/ldap_util.h @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdarg.h> #include <syslog.h> @@ -83,26 +81,27 @@ typedef struct { extern unsigned long numMisaligned; /* Exported functions */ -void logmsg(int msgtype, int priority, char *fmt, ...); +void logmsg(int msgtype, int priority, const char *fmt, ...); void reportError(int error, char *fmt, ...); int getError(char **message); void clearError(void); void logError(int priority); -void *am(char *msg, int size); -int slen(char *str); -char *sdup(char *msg, int allocate, char *str); -char *scat(char *msg, int deallocate, char *s1, char *s2); +void *am(const char *msg, int size); +int slen(const char *str); +char *sdup(const char *msg, int allocate, char *str); +char *scat(const char *msg, int deallocate, char *s1, char *s2); void sfree(void *ptr); char lastChar(__nis_single_value_t *v); void *appendString2SingleVal(char *str, __nis_single_value_t *v, int *newLen); int scmp(char *s, __nis_single_value_t *v); int scasecmp(char *s, __nis_single_value_t *v); -int vp2buf(char *msg, char **buf, int buflen, char *fmt, va_list ap); +int vp2buf(const char *msg, char **buf, int buflen, const char *fmt, + va_list ap); void p2buf(char *msg, char *fmt, ...); -void bp2buf(char *msg, __nis_buffer_t *b, char *fmt, ...); -void bc2buf(char *msg, void *buf, int len, __nis_buffer_t *b); -void sbc2buf(char *msg, void *buf, int len, __nis_buffer_t *b); +void bp2buf(const char *msg, __nis_buffer_t *b, const char *fmt, ...); +void bc2buf(const char *msg, void *buf, int len, __nis_buffer_t *b); +void sbc2buf(const char *msg, void *buf, int len, __nis_buffer_t *b); void c2buf(char *msg, void *buf, int len); void sc2buf(char *msg, void *buf, int len); void printbuf(void); diff --git a/usr/src/lib/libnisdb/nis_db.cc b/usr/src/lib/libnisdb/nis_db.cc index 9bd80cd86f..9d5b62deb3 100644 --- a/usr/src/lib/libnisdb/nis_db.cc +++ b/usr/src/lib/libnisdb/nis_db.cc @@ -61,11 +61,11 @@ db_status db_table_exists(char *table_name); * 'tbl_prototype' is used to create a table that holds a directory. */ static table_col cols[2] = { - {"object", TA_BINARY+TA_XDR, 0}, - {"name", TA_CASE+TA_SEARCHABLE, 0} + {(char *)"object", TA_BINARY+TA_XDR, 0}, + {(char *)"name", TA_CASE+TA_SEARCHABLE, 0} }; -table_obj tbl_prototype = { "DIRECTORY", 2, ' ', {2, &cols[0]}, NULL }; +table_obj tbl_prototype = { (char *)"DIRECTORY", 2, ' ', {2, &cols[0]}, NULL }; } /* @@ -148,10 +148,10 @@ db_in_dict_file(char *name) } -char +const char *db_perror(db_status dbstat) { - char *str = NULL; + const char *str = NULL; switch (dbstat) { case DB_SUCCESS: @@ -451,7 +451,7 @@ db_list_entries(char *table_name, int numattrs, nis_attr *attrname) { char * entryName(char *msg, char *objName, char **tableP) { char *name, *table, *dir; - char *myself = "entryName"; + char *myself = (char *)"entryName"; if (msg == 0) msg = myself; @@ -505,7 +505,7 @@ dbFindObject(char *objName, db_status *statP) { db_mindex *mindex; nis_object *o; int lstat; - char *myself = "dbFindObject"; + const char *myself = "dbFindObject"; if (objName == 0) RETSTAT(0, DB_BADQUERY); @@ -527,7 +527,7 @@ dbFindObject(char *objName, db_status *statP) { /* If not the root dir, find the directory where the entry lives */ sfree(table); - name = entryName(myself, objName, &table); + name = entryName((char *)myself, objName, &table); if (name == 0 || table == 0) { sfree(name); RETSTAT(0, DB_MEMORY_LIMIT); @@ -548,7 +548,7 @@ dbFindObject(char *objName, db_status *statP) { RETSTAT(0, DB_LOCK_ERROR); } - attr.zattr_ndx = "name"; + attr.zattr_ndx = (char *)"name"; attr.zattr_val.zattr_val_val = name; attr.zattr_val.zattr_val_len = slen(name) + 1; @@ -611,7 +611,7 @@ nis_object * ldapFindObj(__nis_table_mapping_t *t, char *objName, int *statP) { nis_object *o; int stat; - char *myself = "ldapFindObj"; + const char *myself = "ldapFindObj"; if (t == 0) { char *table, tbuf[MAXPATHLEN + NIS_MAXNAMELEN + 1]; @@ -656,7 +656,7 @@ findObj(char *name, db_status *statP, int *lstatP) { nis_object *o; db_status stat = DB_SUCCESS; int lstat = LDAP_SUCCESS; - char *myself = "findObj"; + const char *myself = "findObj"; o = dbFindObject(name, &stat); @@ -695,7 +695,7 @@ dbDeleteObj(char *objName) { db_status stat; nisdb_obj_del_t *nod, *tmp; int xid; - char *myself = "dbDeleteObj"; + const char *myself = "dbDeleteObj"; if (objName == 0) return (DB_SUCCESS); @@ -737,7 +737,7 @@ dbDeleteObj(char *objName) { nod->objType = o->zo_data.zo_type; nis_destroy_object(o); - nod->objName = sdup(myself, T, objName); + nod->objName = sdup((char *)myself, T, objName); if (nod->objName == 0) { sfree(nod); return (DB_MEMORY_LIMIT); @@ -772,7 +772,7 @@ dbTouchObj(char *objName) { nis_attr attr; db_query *query; db_status stat; - char *myself = "dbTouchObj"; + const char *myself = "dbTouchObj"; table = internalTableName(objName); if (table == 0) @@ -789,7 +789,7 @@ dbTouchObj(char *objName) { sfree(table); table = 0; - ent = entryName(myself, objName, &table); + ent = entryName((char *)myself, objName, &table); if (ent == 0 || table == 0) { sfree(ent); return (DB_MEMORY_LIMIT); @@ -804,7 +804,7 @@ dbTouchObj(char *objName) { return (DB_BADTABLE); } - attr.zattr_ndx = "name"; + attr.zattr_ndx = (char *)"name"; attr.zattr_val.zattr_val_val = ent; attr.zattr_val.zattr_val_len = slen(ent) + 1; @@ -833,7 +833,7 @@ dbCreateTable(char *intName, nis_object *obj) { table_col tc[NIS_MAXCOLUMNS+1]; table_obj tobj, *t; int i; - char *myself = "dbCreateTable"; + const char *myself = "dbCreateTable"; if (intName == 0 || obj == 0) return (DB_BADTABLE); @@ -879,7 +879,7 @@ dbRefreshObj(char *name, nis_object *o) { db_status stat; char *ent, *table, *objTable; int rstat, isDir = 0, isTable = 0; - char *myself = "refreshObj"; + const char *myself = "refreshObj"; if (o == 0) /* Delete it */ @@ -973,7 +973,7 @@ dbRefreshObj(char *name, nis_object *o) { if (strcmp(ROOTDIRFILE, objTable) == 0) { sfree(objTable); - rstat = update_root_object(ROOTOBJFILE, o); + rstat = update_root_object((char *)ROOTOBJFILE, o); if (rstat == 1) stat = DB_SUCCESS; else @@ -989,7 +989,7 @@ dbRefreshObj(char *name, nis_object *o) { int lstat; /* Find parent */ - ent = entryName(myself, objName, &table); + ent = entryName((char *)myself, objName, &table); if (ent == 0 || table == 0) { sfree(b.buf); sfree(objTable); @@ -1018,7 +1018,7 @@ dbRefreshObj(char *name, nis_object *o) { } /* Construct suitable nis_attr and entry_object */ - attr.zattr_ndx = "name"; + attr.zattr_ndx = (char *)"name"; attr.zattr_val.zattr_val_val = ent; attr.zattr_val.zattr_val_len = slen(ent) + 1; @@ -1026,7 +1026,7 @@ dbRefreshObj(char *name, nis_object *o) { ec[1].ec_value.ec_value_val = ent; ec[1].ec_value.ec_value_len = attr.zattr_val.zattr_val_len; - eo.en_type = "IN_DIRECTORY"; + eo.en_type = (char *)"IN_DIRECTORY"; eo.en_cols.en_cols_val = ec; eo.en_cols.en_cols_len = 2; @@ -1224,7 +1224,7 @@ dbCreateFromLDAP(char *intName, int *ldapStat) { int lstat, doDestroy; nis_object *obj = 0; db_status dstat; - char *myself = "dbCreateFromLDAP"; + const char *myself = "dbCreateFromLDAP"; if (!useLDAPrespository) { if (ldapStat != 0) @@ -1279,7 +1279,7 @@ loadAllLDAP(int fromLDAP, void *cookie, db_status *dstatP) { db *dbase; db_table_desc *tbl = 0; db_mindex *mindex; - char *myself = "loadAllLDAP"; + const char *myself = "loadAllLDAP"; /* * If the 'cookie' and '*cookie' are non-NULL, start scanning @@ -1416,7 +1416,8 @@ loadAllLDAP(int fromLDAP, void *cookie, db_status *dstatP) { ent = 0; } else { objPath = 0; - ent = entryName(myself, t->objName, &objPath); + ent = entryName((char *)myself, t->objName, + &objPath); if (ent == 0 || objPath == 0) { logmsg(MSG_NOTIMECHECK, LOG_ERR, "%s: Error deriving entry/DB-table names for %s:%s; skipping up-load", @@ -1474,7 +1475,7 @@ loadAllLDAP(int fromLDAP, void *cookie, db_status *dstatP) { nis_attr attr; db_query *q; - attr.zattr_ndx = "name"; + attr.zattr_ndx = (char *)"name"; attr.zattr_val.zattr_val_val = ent; attr.zattr_val.zattr_val_len = slen(ent) + 1; diff --git a/usr/src/lib/libnisdb/nis_parse_ldap_yp_util.c b/usr/src/lib/libnisdb/nis_parse_ldap_yp_util.c index b59dff72d6..70c2741ec6 100644 --- a/usr/src/lib/libnisdb/nis_parse_ldap_yp_util.c +++ b/usr/src/lib/libnisdb/nis_parse_ldap_yp_util.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdio.h> #include <string.h> #include <stdlib.h> @@ -174,7 +172,7 @@ merge_table_mapping( } if (out->commentChar == DEFAULT_COMMENT_CHAR && - in->commentChar != DEFAULT_COMMENT_CHAR) + in->commentChar != DEFAULT_COMMENT_CHAR) out->commentChar = in->commentChar; if (out->usedns_flag == 0) @@ -183,8 +181,8 @@ merge_table_mapping( if (out->securemap_flag == 0) out->securemap_flag = in->securemap_flag; - if (out->separatorStr == DEFAULT_SEP_STRING && - in->separatorStr != DEFAULT_SEP_STRING) { + if ((strcmp(out->separatorStr, DEFAULT_SEP_STRING) == 0) && + (strcmp(in->separatorStr, DEFAULT_SEP_STRING) != 0)) { out->separatorStr = s_strdup(in->separatorStr); if (!out->separatorStr) return (2); @@ -193,8 +191,8 @@ merge_table_mapping( if (!out->numSplits && !out->e && in->e) { out->numSplits = in->numSplits; out->e = (__nis_mapping_element_t *) - s_calloc(1, (in->numSplits+1) * - sizeof (__nis_mapping_element_t)); + s_calloc(1, (in->numSplits+1) * + sizeof (__nis_mapping_element_t)); if (!out->e) return (2); for (i = 0; i <= in->numSplits; i++) { @@ -209,20 +207,20 @@ merge_table_mapping( } if (out->initTtlLo == (time_t)NO_VALUE_SET && - in->initTtlLo != (time_t)NO_VALUE_SET) + in->initTtlLo != (time_t)NO_VALUE_SET) out->initTtlLo = in->initTtlLo; if (out->initTtlHi == (time_t)NO_VALUE_SET && - in->initTtlHi != (time_t)NO_VALUE_SET) + in->initTtlHi != (time_t)NO_VALUE_SET) out->initTtlHi = in->initTtlHi; if (out->ttl == (time_t)NO_VALUE_SET && - in->ttl != (time_t)NO_VALUE_SET) + in->ttl != (time_t)NO_VALUE_SET) out->ttl = in->ttl; if (!out->numRulesFromLDAP && in->numRulesFromLDAP) { out->ruleFromLDAP = dup_mapping_rules(in->ruleFromLDAP, - in->numRulesFromLDAP); + in->numRulesFromLDAP); if (!out->ruleFromLDAP) return (1); out->numRulesFromLDAP = in->numRulesFromLDAP; @@ -231,7 +229,7 @@ merge_table_mapping( for (i = 0; i < in->numRulesFromLDAP; i++) { if (append_mapping_rule(in->ruleFromLDAP[i], out, 0)) { for (i = out->numRulesFromLDAP; - i > orig_num_rules; i--) { + i > orig_num_rules; i--) { free_mapping_rule(out->ruleFromLDAP[i]); out->ruleFromLDAP[i] = NULL; } @@ -243,7 +241,7 @@ merge_table_mapping( if (!out->numRulesToLDAP && in->numRulesToLDAP) { out->ruleToLDAP = dup_mapping_rules(in->ruleToLDAP, - in->numRulesToLDAP); + in->numRulesToLDAP); if (!out->ruleToLDAP) return (1); out->numRulesToLDAP = in->numRulesToLDAP; @@ -252,7 +250,7 @@ merge_table_mapping( for (i = 0; i < in->numRulesToLDAP; i++) { if (append_mapping_rule(in->ruleToLDAP[i], out, 1)) { for (i = out->numRulesToLDAP; - i > orig_num_rules; i--) { + i > orig_num_rules; i--) { free_mapping_rule(out->ruleToLDAP[i]); out->ruleToLDAP[i] = NULL; } @@ -262,7 +260,7 @@ merge_table_mapping( } if (!out->objectDN && in->objectDN) { out->objectDN = (__nis_object_dn_t *) - s_calloc(1, sizeof (__nis_object_dn_t)); + s_calloc(1, sizeof (__nis_object_dn_t)); if (!out->objectDN) return (2); if (copy_object_dn(in->objectDN, out->objectDN)) { @@ -274,9 +272,9 @@ merge_table_mapping( if (!out->objName && in->objName) { if (!strchr(in->objName, SPACE_CHAR)) { - /* objName has no space- a single map dbIdMapping */ + /* objName has no space- a single map dbIdMapping */ out->objName = s_strndup(in->objName, - strlen(in->objName)); + strlen(in->objName)); if (!out->objName) return (2); } @@ -306,9 +304,7 @@ merge_table_mapping( */ static int -copy_object_dn( - __nis_object_dn_t *in, - __nis_object_dn_t *newdn) +copy_object_dn(__nis_object_dn_t *in, __nis_object_dn_t *newdn) { if (in == NULL) { p_error = parse_no_object_dn; @@ -319,16 +315,14 @@ copy_object_dn( newdn->read.base = NULL; } else { newdn->read.base = s_strndup( - in->read.base, - strlen(in->read.base)); + in->read.base, strlen(in->read.base)); if (newdn->read.base == NULL) return (2); } newdn->read.scope = in->read.scope; if (in->read.attrs) { newdn->read.attrs = s_strndup( - in->read.attrs, - strlen(in->read.attrs)); + in->read.attrs, strlen(in->read.attrs)); if (newdn->read.attrs == NULL) { return (2); } @@ -338,8 +332,7 @@ copy_object_dn( newdn->read.element = in->read.element; if (in->write.base != NULL) { newdn->write.base = s_strndup( - in->write.base, - strlen(in->write.base)); + in->write.base, strlen(in->write.base)); if (newdn->write.base == NULL) return (2); } else { @@ -348,8 +341,7 @@ copy_object_dn( newdn->write.scope = in->write.scope; if (in->write.attrs != NULL) { newdn->write.attrs = s_strndup( - in->write.attrs, - strlen(in->write.attrs)); + in->write.attrs, strlen(in->write.attrs)); if (newdn->write.attrs == NULL) { return (2); } @@ -359,7 +351,7 @@ copy_object_dn( newdn->write.element = in->write.element; if (in->dbIdName) { newdn->dbIdName = s_strndup(in->dbIdName, - strlen(in->dbIdName)); + strlen(in->dbIdName)); if (newdn->dbIdName == NULL) return (2); } @@ -369,14 +361,14 @@ copy_object_dn( if (in->dbId && in->numDbIds > 0) { newdn->dbId = dup_mapping_rules(in->dbId, - in->numDbIds); + in->numDbIds); if (!newdn->dbId) return (1); newdn->numDbIds = in->numDbIds; } if (in->next != NULL) { newdn->next = (__nis_object_dn_t *)s_calloc(1, - sizeof (__nis_object_dn_t)); + sizeof (__nis_object_dn_t)); if (newdn->next == NULL) return (1); newdn = newdn->next; @@ -417,8 +409,8 @@ free_yp_domain_context(__yp_domain_context_t *domains) for (i = 0; i < domains->numYppasswdd; i++) { if (domains->yppasswddDomainLabels[i] != NULL) { free(domains->yppasswddDomainLabels[i]); - domains->yppasswddDomainLabels[i] - = NULL; + domains->yppasswddDomainLabels[i] = + NULL; } } domains->yppasswddDomainLabels = NULL; @@ -437,8 +429,7 @@ free_yp_domain_context(__yp_domain_context_t *domains) * RETURN VALUE: 0 on success, > 0 on failure. */ int -second_parser_pass( - __nis_table_mapping_t **table_mapping) +second_parser_pass(__nis_table_mapping_t **table_mapping) { __nis_table_mapping_t *t, *t2; __nis_table_mapping_t *t_new = NULL, *tg; @@ -466,7 +457,7 @@ second_parser_pass( if (!t->dbId) { p_error = parse_bad_map_error; logmsg(MSG_NOTIMECHECK, LOG_ERR, - "%s: no dbId field", myself); + "%s: no dbId field", myself); return (1); } tg = NULL; @@ -476,24 +467,25 @@ second_parser_pass( if (objName == NULL) { p_error = parse_no_mem_error; logmsg(MSG_NOMEM, LOG_ERR, - "%s: Cannot allocate memory for objName", myself); + "%s: Cannot allocate memory for objName", + myself); return (1); } objs = (char *)strtok_r(objName, " ", &lasts); /* Get the generic mapping */ if (dom != NULL) { tg = find_table_mapping(t->dbId, dom - t->dbId, - *table_mapping); + *table_mapping); } } else { objs = NULL; if (dom == NULL) { t->objName = s_strndup(t->dbId, - strlen(t->dbId)); + strlen(t->dbId)); if (!t->objName) { logmsg(MSG_NOMEM, LOG_ERR, -"%s: Cannot allocate memory for t->objName", - myself); + "%s: Cannot allocate memory for " + "t->objName", myself); objs = NULL; return (2); } @@ -502,39 +494,39 @@ second_parser_pass( /* Get the generic mapping */ tg = find_table_mapping(t->dbId, dom - t->dbId, - *table_mapping); + *table_mapping); if (tg == NULL || tg->objName == NULL) { /* If not found, use dbId for objName */ t->objName = s_strndup(t->dbId, - strlen(t->dbId)); + strlen(t->dbId)); if (t->objName == NULL) { logmsg(MSG_NOMEM, LOG_ERR, -"%s: Cannot allocate memory for t->objName", - myself); + "%s: Cannot allocate memory for t->objName", + myself); return (2); } } else { dom++; tobj = s_strndup(tg->objName, - strlen(tg->objName)); + strlen(tg->objName)); if (tobj == NULL) { logmsg(MSG_NOMEM, LOG_ERR, -"%s: Cannot allocate memory for t->objName", - myself); + "%s: Cannot allocate memory for t->objName", + myself); return (2); } alias = (char *)strtok_r(tobj, " ", - &lasts); + &lasts); /* Loop 'breaks' on errors */ while (alias) { tmp = NULL; dupalias = s_strndup(alias, - strlen(alias)); + strlen(alias)); if (!dupalias) break; if (getfullmapname(&dupalias, - dom)) { + dom)) { i = 1; break; } @@ -542,41 +534,43 @@ second_parser_pass( t->objName = dupalias; else { len = strlen(t->objName) - + strlen(dupalias) + 2; + + strlen(dupalias) + + 2; tmp = s_calloc(1, len); if (tmp == NULL) break; snprintf(tmp, len, - "%s %s", - t->objName, - dupalias); + "%s %s", + t->objName, + dupalias); free(dupalias); dupalias = NULL; free(t->objName); t->objName = tmp; } alias = (char *)strtok_r(NULL, - " ", &lasts); + " ", &lasts); } if (tobj) free(tobj); if (alias || - (objName = s_strdup(t->objName)) - == NULL) { + (objName = s_strdup(t->objName)) + == NULL) { if (i) logmsg(MSG_NOTIMECHECK, - LOG_ERR, -"%s: getfullmapname failed for %s for domain \"%s\"", - myself, dupalias, dom); + LOG_ERR, + "%s: getfullmapname failed for %s for domain \"%s\"", + myself, dupalias, + dom); else { p_error = - parse_no_mem_error; + parse_no_mem_error; logmsg(MSG_NOMEM, - LOG_ERR, -"%s: Cannot allocate memory", - myself); + LOG_ERR, + "%s: Cannot allocate memory", + myself); } if (dupalias) free(dupalias); @@ -586,7 +580,7 @@ second_parser_pass( } objs = (char *)strtok_r(objName, " ", - &lasts); + &lasts); } } } @@ -594,8 +588,8 @@ second_parser_pass( if (tg != NULL) { if (merge_table_mapping(tg, t)) { logmsg(MSG_NOTIMECHECK, LOG_ERR, -"Error merging information from the %s to the %s mapping structure", - tg->dbId, t->dbId); + "Error merging information from the %s to the %s mapping structure", + tg->dbId, t->dbId); objs = NULL; if (objName) free(objName); @@ -609,14 +603,14 @@ second_parser_pass( * Also skip it if t->objName is null. */ if (objs && strncasecmp(objs, t->objName, - strlen(t->objName))) { + strlen(t->objName))) { t2 = find_table_mapping(objs, strlen(objs), - *table_mapping); + *table_mapping); if (t2) { if (merge_table_mapping(t, t2)) { logmsg(MSG_NOTIMECHECK, LOG_ERR, -"Error merging information from the %s to the %s mapping structure", - t->dbId, t2->dbId); + "Error merging information from the %s to the %s mapping structure", + t->dbId, t2->dbId); objs = NULL; if (objName) free(objName); @@ -635,8 +629,8 @@ second_parser_pass( prev->next = t; } else { logmsg(MSG_NOTIMECHECK, LOG_ERR, -"Error creating a new mapping structure %s", - objs); + "Error creating a new mapping structure %s", + objs); objs = NULL; if (objName) free(objName); @@ -644,14 +638,14 @@ second_parser_pass( } } while ((objs = (char *)strtok_r(NULL, " ", &lasts)) - != NULL) { + != NULL) { t2 = find_table_mapping(objs, strlen(objs), - *table_mapping); + *table_mapping); if (t2) { if (merge_table_mapping(t, t2)) { logmsg(MSG_NOTIMECHECK, LOG_ERR, -"Error merging information from the %s to the %s mapping structure", - t->dbId, t2->dbId); + "Error merging information from the %s to the %s mapping structure", + t->dbId, t2->dbId); objs = NULL; if (objName) free(objName); @@ -674,8 +668,8 @@ second_parser_pass( prev->next = t; } else { logmsg(MSG_NOTIMECHECK, LOG_ERR, -"Error creating a new mapping structure %s", - objs); + "Error creating a new mapping structure %s", + objs); objs = NULL; if (objName) free(objName); @@ -705,7 +699,7 @@ new_merged_mapping(const char *match, __nis_table_mapping_t *outtable = NULL; outtable = (__nis_table_mapping_t *) - s_calloc(1, sizeof (__nis_table_mapping_t)); + s_calloc(1, sizeof (__nis_table_mapping_t)); if (outtable == NULL) return (NULL); initialize_table_mapping(outtable); @@ -750,13 +744,13 @@ final_parser_pass( if (!ypDomains->numDomains) { p_error = parse_internal_error; logmsg(MSG_NOTIMECHECK, LOG_ERR, - "%s:No domains specified.", myself); + "%s:No domains specified.", myself); return (-1); } } else { p_error = parse_internal_error; logmsg(MSG_NOTIMECHECK, LOG_ERR, - "%s:No domain structure supplied.", myself); + "%s:No domain structure supplied.", myself); return (-1); } prev = NULL; @@ -779,7 +773,7 @@ final_parser_pass( t->objName = s_strndup(t->dbId, strlen(t->dbId)); if (!t->objName) { logmsg(MSG_NOMEM, LOG_ERR, - "%s:Could not allocate.", myself); + "%s:Could not allocate.", myself); return (-1); } } @@ -788,23 +782,24 @@ final_parser_pass( if (i == 1) { /* modify existing table_mapping's */ nm = checkfullmapname(t->dbId, - ypDomains->domainLabels[0], - table_mapping, &returned_map); + ypDomains->domainLabels[0], + table_mapping, &returned_map); if (nm == 1) { /* delete this mapping structure */ logmsg(MSG_NOTIMECHECK, - LOG_WARNING, - "Mapping structure %s,%s " - "already exists.", - t->dbId, - ypDomains->domainLabels[0]); + LOG_WARNING, + "Mapping structure %s,%s " + "already exists.", + t->dbId, + ypDomains->domainLabels[0]); if (merge_table_mapping(t, - returned_map)) { + returned_map)) { logmsg(MSG_NOTIMECHECK, LOG_ERR, "Error merging information " "from the %s to the %s " "mapping structure.", - t->dbId, returned_map->dbId); + t->dbId, + returned_map->dbId); return (-1); } if (del_tbl_flag == 0) @@ -812,15 +807,16 @@ final_parser_pass( } else if (nm == -1) { logmsg(MSG_NOTIMECHECK, LOG_ERR, "Error searching for %s,%s structure", - t->dbId, ypDomains->domainLabels[0]); + t->dbId, + ypDomains->domainLabels[0]); return (-1); } else if (nm == 0 || nm == 2) { if ((append_domainContext(&t, - ypDomains->domainLabels[0], - ypDomains->domains[0])) != 0) { + ypDomains->domainLabels[0], + ypDomains->domains[0])) != 0) { logmsg(MSG_NOTIMECHECK, LOG_ERR, "Error appending domainContext %s", - ypDomains->domainLabels[0]); + ypDomains->domainLabels[0]); return (-1); } del_tbl_flag = 0; @@ -828,12 +824,13 @@ final_parser_pass( } else { /* if (i > 1) */ /* need to create new table_mapping's */ nm = checkfullmapname(t->dbId, - ypDomains->domainLabels[i - 1], - table_mapping, &returned_map); + ypDomains->domainLabels[i - 1], + table_mapping, &returned_map); if (nm == -1) { logmsg(MSG_NOTIMECHECK, LOG_ERR, "Error searching for %s,%s structure", - t->dbId, ypDomains->domainLabels[i - 1]); + t->dbId, + ypDomains->domainLabels[i - 1]); return (-1); } else if (nm == 0) { t1 = new_merged_mapping(t->dbId, t); @@ -854,7 +851,7 @@ final_parser_pass( prev = prev->next; } else { t1->next = - *table_mapping; + *table_mapping; *table_mapping = t1; prev = t1; } @@ -863,14 +860,14 @@ final_parser_pass( logmsg(MSG_NOTIMECHECK, LOG_ERR, "%s:Could not create new table -" " check all instances of %s for errors", - myself, t->dbId); + myself, t->dbId); return (-1); } } else if (nm == 1) { logmsg(MSG_NOTIMECHECK, LOG_WARNING, "Mapping structure %s,%s already exists.", - t->dbId, - ypDomains->domainLabels[i - 1]); + t->dbId, + ypDomains->domainLabels[i - 1]); /* * We should be deleting this, but can't * really do it here, because we need to @@ -878,19 +875,18 @@ final_parser_pass( * too. So we will just flag it for now. */ if (merge_table_mapping(t, - returned_map)) { + returned_map)) { logmsg(MSG_NOTIMECHECK, LOG_ERR, "Error merging information from the %s to the %s mapping structure.", - t->dbId, - returned_map->dbId); + t->dbId, + returned_map->dbId); return (-1); } del_tbl_flag = 1; } else if (nm == 2) { if ((append_domainContext(&t, - ypDomains->domainLabels[i - 1], - ypDomains->domains[i - 1])) - != 0) { + ypDomains->domainLabels[i - 1], + ypDomains->domains[i - 1])) != 0) { logmsg(MSG_NOTIMECHECK, LOG_ERR, "Error appending domainContext %s", ypDomains->domainLabels[i - 1]); @@ -908,21 +904,21 @@ final_parser_pass( */ if (nm == 1 && returned_map && returned_map->objectDN) { r = make_fqdn( - returned_map->objectDN, - ypDomains->domains[i - 1]); + returned_map->objectDN, + ypDomains->domains[i - 1]); if (r == TRUE && - returned_map->objectDN->write.base) { + returned_map->objectDN->write.base) { r = make_full_dn( - &returned_map->objectDN->write.base, - ypDomains->domains[i - 1]); + &returned_map->objectDN->write.base, + ypDomains->domains[i - 1]); } if (r == FALSE) { logmsg(MSG_NOTIMECHECK, LOG_ERR, - "Error appending domainContext " - "%s to %s", - ypDomains->domainLabels[i - 1], - returned_map->dbId); + "Error appending domainContext " + "%s to %s", + ypDomains->domainLabels[i - 1], + returned_map->dbId); return (-2); } } @@ -949,15 +945,15 @@ final_parser_pass( for (t = *table_mapping; t != NULL; t = t->next) { if (!t->dbId) { logmsg(MSG_NOTIMECHECK, LOG_ERR, - "%s:Fatal error: structure with no dbId found.", - myself); - return (-2); + "%s:Fatal error: structure with no dbId found.", + myself); + return (-2); } append_dot(&t->dbId); if (!t->objectDN) { p_error = parse_internal_error; logmsg(MSG_NOTIMECHECK, LOG_ERR, - "%s:No objectDN for %s.", myself, t->dbId); + "%s:No objectDN for %s.", myself, t->dbId); return (-1); } } @@ -987,9 +983,9 @@ append_mapping_rule(__nis_mapping_rule_t *src_rule, return (1); } rules = (__nis_mapping_rule_t **) - s_realloc(dst->ruleFromLDAP, - (dst->numRulesFromLDAP + 1) * - sizeof (__nis_mapping_rule_t *)); + s_realloc(dst->ruleFromLDAP, + (dst->numRulesFromLDAP + 1) * + sizeof (__nis_mapping_rule_t *)); if (rules == NULL) return (2); dst->ruleFromLDAP = rules; @@ -1005,9 +1001,9 @@ append_mapping_rule(__nis_mapping_rule_t *src_rule, return (1); } rules = (__nis_mapping_rule_t **) - s_realloc(dst->ruleToLDAP, - (dst->numRulesToLDAP + 1) * - sizeof (__nis_mapping_rule_t *)); + s_realloc(dst->ruleToLDAP, + (dst->numRulesToLDAP + 1) * + sizeof (__nis_mapping_rule_t *)); if (rules == NULL) return (2); dst->ruleToLDAP = rules; @@ -1052,12 +1048,12 @@ check_domain_specific_order(const char *sd, if (ypDomains) { if (!ypDomains->numDomains) { logmsg(MSG_NOTIMECHECK, LOG_ERR, - "%s:No domains specified.", myself); + "%s:No domains specified.", myself); return (-1); } } else { logmsg(MSG_NOTIMECHECK, LOG_ERR, - "%s:No domain structure supplied.", myself); + "%s:No domain structure supplied.", myself); return (-1); } @@ -1065,43 +1061,43 @@ check_domain_specific_order(const char *sd, for (t = table_mapping; t != NULL; t = t->next) { len = strlen(sd); if ((strcasecmp(t->dbId, sd) == 0) && (len == - strlen(t->dbId))) + strlen(t->dbId))) /* prevent from matching against itself */ continue; dbId = s_strndup(t->dbId, strlen(t->dbId)); if (dbId == NULL) { logmsg(MSG_NOMEM, LOG_ERR, - "%s:Memory allocation error.", myself); + "%s:Memory allocation error.", myself); return (-1); } if (getfullmapname(&dbId, - ypDomains->domainLabels[i])) { + ypDomains->domainLabels[i])) { logmsg(MSG_NOTIMECHECK, LOG_ERR, "Error getting fully qualified name for %s", - dbId); + dbId); free(dbId); return (-1); } if ((strcasecmp(dbId, sd) == 0) && (len == - strlen(dbId))) { + strlen(dbId))) { match = 0; switch (attrib_num) { case key_yp_map_flags: if (t->usedns_flag != 0 || - t->securemap_flag != 0) + t->securemap_flag != 0) match = 1; type = YP_MAP_FLAGS; break; case key_yp_comment_char: if (t->commentChar != - DEFAULT_COMMENT_CHAR) + DEFAULT_COMMENT_CHAR) match = 1; type = YP_COMMENT_CHAR; break; case key_yp_repeated_field_separators: - if (t->separatorStr != - DEFAULT_SEP_STRING) + if (strcmp(t->separatorStr, + DEFAULT_SEP_STRING) != 0) match = 1; type = YP_REPEATED_FIELD_SEPARATORS; @@ -1122,7 +1118,7 @@ check_domain_specific_order(const char *sd, break; case key_yp_entry_ttl: if (t->initTtlLo != - (time_t)NO_VALUE_SET) + (time_t)NO_VALUE_SET) match = 1; type = YP_ENTRY_TTL; break; @@ -1149,7 +1145,7 @@ check_domain_specific_order(const char *sd, if (match) { logmsg(MSG_NOTIMECHECK, LOG_ERR, "Relative attribute '%s' of type '%s' found before fully qualified one '%s'", - t->dbId, type, sd); + t->dbId, type, sd); free(dbId); dbId = NULL; return (1); @@ -1173,7 +1169,7 @@ getfullmapname(char **mapname, const char *domainname) int domainlen = strlen(domainname); if (!maplen || !domainlen || - maps[maplen - 1] == PERIOD_CHAR) + maps[maplen - 1] == PERIOD_CHAR) return (1); else if (strchr(maps, COMMA_CHAR)) { /* map already has a domain part, do nothing */ @@ -1184,7 +1180,7 @@ getfullmapname(char **mapname, const char *domainname) maps = realloc(maps, (maplen + domainlen + 1)); if (maps != NULL) { if (strlcat(maps, domainname, (maplen + domainlen + 1)) - >= (maplen + domainlen + 1)) + >= (maplen + domainlen + 1)) return (1); *mapname = maps; return (0); @@ -1317,11 +1313,11 @@ char *DomainLabel, char *Domain) if (tmp_map->objectDN == NULL) { /* Allocate memory to objectDN */ tmp_map->objectDN = (__nis_object_dn_t *) - s_calloc(1, sizeof (__nis_object_dn_t)); + s_calloc(1, sizeof (__nis_object_dn_t)); if (tmp_map->objectDN == NULL) { logmsg(MSG_NOMEM, LOG_ERR, "%s: Cannot allocate memory for objectDN", - myself); + myself); return (2); } tmp_map->objectDN->read.base = NULL; diff --git a/usr/src/lib/libtsol/common/call_labeld.c b/usr/src/lib/libtsol/common/call_labeld.c index 8ae29742be..1685f222f6 100644 --- a/usr/src/lib/libtsol/common/call_labeld.c +++ b/usr/src/lib/libtsol/common/call_labeld.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <door.h> #include <errno.h> #include <fcntl.h> @@ -139,14 +137,14 @@ try_again: if ((doorfd = dup(doorfd)) < 0) { perror("couldn't dup"); while (i--) - (void) close(tbc[i]); + (void) close(tbc[i]); doorfd = -1; (void) mutex_unlock(&_door_lock); return (NOSERVER); } } while (i--) - (void) close(tbc[i]); + (void) close(tbc[i]); /* * mark this door descriptor as close on exec @@ -193,7 +191,7 @@ try_again: (void) printf("\t\t id = %llx\n", real_door.di_uniquifier); #endif /* DEBUG */ if ((real_door.di_attributes & DOOR_REVOKED) || - (real_door.di_data != (door_ptr_t)COOKIE)) { + (real_door.di_data != (door_ptr_t)(uintptr_t)COOKIE)) { #ifdef DEBUG (void) printf("real door revoked\n"); #endif /* DEBUG */ @@ -204,8 +202,8 @@ try_again: } } else { if ((door_info(doorfd, &my_door) < 0) || - (my_door.di_data != (door_ptr_t)COOKIE) || - (my_door.di_uniquifier != real_door.di_uniquifier)) { + (my_door.di_data != (door_ptr_t)(uintptr_t)COOKIE) || + (my_door.di_uniquifier != real_door.di_uniquifier)) { perror("my door door_info"); /* * don't close it - someone else has clobbered fd diff --git a/usr/src/lib/lvm/libmeta/common/meta_metad_subr.c b/usr/src/lib/lvm/libmeta/common/meta_metad_subr.c index aa352a266d..f39f2fa14c 100644 --- a/usr/src/lib/lvm/libmeta/common/meta_metad_subr.c +++ b/usr/src/lib/lvm/libmeta/common/meta_metad_subr.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Just in case we're not in a build environment, make sure that * TEXT_DOMAIN gets set to something. @@ -242,20 +240,19 @@ get_db_rec( reqp->ur_type2 = type2; switch (cmd) { - case MD_UR_GET_NEXT: - reqp->ur_cmd = MD_DB_GETNEXTREC; - reqp->ur_recid = *idp; - if (metaioctl(ureq, reqp, &reqp->ur_mde, NULL) - != 0) { - (void) mdstealerror(ep, &reqp->ur_mde); - Free(reqp); - return (NULL); - } - *idp = reqp->ur_recid; - break; - case MD_UR_GET_WKEY: - reqp->ur_recid = *idp; - break; + case MD_UR_GET_NEXT: + reqp->ur_cmd = MD_DB_GETNEXTREC; + reqp->ur_recid = *idp; + if (metaioctl(ureq, reqp, &reqp->ur_mde, NULL) != 0) { + (void) mdstealerror(ep, &reqp->ur_mde); + Free(reqp); + return (NULL); + } + *idp = reqp->ur_recid; + break; + case MD_UR_GET_WKEY: + reqp->ur_recid = *idp; + break; } if (*idp <= 0) { @@ -283,17 +280,17 @@ get_db_rec( } switch (reqp->ur_type) { - case MDDB_USER: - switch (reqp->ur_type2) { - case MDDB_UR_SR: - if (ckncvt_set_record(reqp, ep)) { - Free((void *)(uintptr_t)reqp->ur_data); - Free(reqp); - return (NULL); - } - break; - } - break; + case MDDB_USER: + switch (reqp->ur_type2) { + case MDDB_UR_SR: + if (ckncvt_set_record(reqp, ep)) { + Free((void *)(uintptr_t)reqp->ur_data); + Free(reqp); + return (NULL); + } + break; + } + break; } return (reqp); @@ -337,9 +334,9 @@ get_ur_rec( static int sr_hosts(md_set_record *sr) { - int i, - nid = 0, - self_in_set = FALSE; + int i; + int nid = 0; + int self_in_set = FALSE; md_error_t xep = mdnullerror; md_mnnode_record *nr; md_mnset_record *mnsr; @@ -483,7 +480,7 @@ sr_drvs(md_set_record *sr) nm.setno = MD_LOCAL_SET; nm.side = nr->nr_nodeid; nm.key = dr->dr_key; - nm.devname = (uint64_t)device_name; + nm.devname = (uintptr_t)device_name; if (metaioctl(MD_IOCGET_NM, &nm, &nm.mde, NULL) != 0) { @@ -530,7 +527,7 @@ sr_drvs(md_set_record *sr) nm.setno = MD_LOCAL_SET; nm.side = i + SKEW; nm.key = dr->dr_key; - nm.devname = (uint64_t)device_name; + nm.devname = (uintptr_t)device_name; if (metaioctl(MD_IOCGET_NM, &nm, &nm.mde, NULL) != 0) { @@ -690,7 +687,7 @@ sr_sidenms(void) continue; add_key_to_lst(&use, i + SKEW, - dr->dr_key); + dr->dr_key); } } } @@ -915,7 +912,7 @@ set_snarf(md_error_t *ep) /* Go get the set records */ id = 0; while ((sr = get_ur_rec(MD_LOCAL_SET, MD_UR_GET_NEXT, MDDB_UR_SR, - &id, ep)) != NULL) { + &id, ep)) != NULL) { sr->sr_next = NULL; sr->sr_drivechain = NULL; @@ -967,7 +964,7 @@ set_snarf(md_error_t *ep) mnsr->sr_nodechain = NULL; p = &mnsr->sr_noderec; while ((nr = get_ur_rec(MD_LOCAL_SET, MD_UR_GET_WKEY, - MDDB_UR_NR, p, ep)) != NULL) { + MDDB_UR_NR, p, ep)) != NULL) { nr->nr_next = NULL; if (md_in_daemon) @@ -1049,7 +1046,7 @@ set_snarf(md_error_t *ep) p = NULL; mnnr_cache_add((struct md_mnset_record *)sr, - nr); + nr); if ((md_in_daemon) && (strcmp(nr->nr_nodename, mynode()) == 0)) { @@ -1059,7 +1056,7 @@ set_snarf(md_error_t *ep) if (metaioctl(MD_MN_SET_NODEID, &snp, &snp.sn_mde, NULL) != 0) { (void) mdstealerror(ep, - &snp.sn_mde); + &snp.sn_mde); } } @@ -1079,7 +1076,7 @@ set_snarf(md_error_t *ep) /* Go get the drive records */ p = &sr->sr_driverec; while ((dr = get_ur_rec(MD_LOCAL_SET, MD_UR_GET_WKEY, - MDDB_UR_DR, p, ep)) != NULL) { + MDDB_UR_DR, p, ep)) != NULL) { dr->dr_next = NULL; if (md_in_daemon) @@ -1360,19 +1357,19 @@ metad_isautotakebyname(char *setname) md_error_t error = mdnullerror; md_set_record *sr; - if (md_in_daemon) - assert(setsnarfdone != 0); - else if (set_snarf(&error)) { - mdclrerror(&error); - return (0); + if (md_in_daemon) { + assert(setsnarfdone != 0); + } else if (set_snarf(&error)) { + mdclrerror(&error); + return (0); } for (sr = setrecords; sr != NULL; sr = sr->sr_next) { - if (strcmp(setname, sr->sr_setname) == 0) { - if (sr->sr_flags & MD_SR_AUTO_TAKE) - return (1); - return (0); - } + if (strcmp(setname, sr->sr_setname) == 0) { + if (sr->sr_flags & MD_SR_AUTO_TAKE) + return (1); + return (0); + } } return (0); @@ -1384,19 +1381,19 @@ metad_isautotakebynum(set_t setno) md_error_t error = mdnullerror; md_set_record *sr; - if (md_in_daemon) - assert(setsnarfdone != 0); - else if (set_snarf(&error)) { - mdclrerror(&error); - return (0); + if (md_in_daemon) { + assert(setsnarfdone != 0); + } else if (set_snarf(&error)) { + mdclrerror(&error); + return (0); } for (sr = setrecords; sr != NULL; sr = sr->sr_next) { - if (setno == sr->sr_setno) { - if (sr->sr_flags & MD_SR_AUTO_TAKE) - return (1); - return (0); - } + if (setno == sr->sr_setno) { + if (sr->sr_flags & MD_SR_AUTO_TAKE) + return (1); + return (0); + } } return (0); diff --git a/usr/src/lib/lvm/libmeta/common/meta_namespace.c b/usr/src/lib/lvm/libmeta/common/meta_namespace.c index 9d2d16bd3f..365ddd11d8 100644 --- a/usr/src/lib/lvm/libmeta/common/meta_namespace.c +++ b/usr/src/lib/lvm/libmeta/common/meta_namespace.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * namespace utilities */ @@ -63,7 +61,7 @@ meta_getnmentbykey( nm.setno = setno; nm.side = sideno; nm.key = key; - nm.devname = (uint64_t)device_name; + nm.devname = (uintptr_t)device_name; if (metaioctl(MD_IOCGET_NM, &nm, &nm.mde, NULL) != 0) { (void) mdstealerror(ep, &nm.mde); @@ -189,7 +187,7 @@ meta_getdidminorbykey( nm.setno = setno; nm.side = sideno; nm.key = key; - nm.minorname = (uint64_t)minorname; + nm.minorname = (uintptr_t)minorname; if (metaioctl(MD_IOCGET_DIDMIN, &nm, &nm.mde, NULL) != 0) { (void) mdstealerror(ep, &nm.mde); @@ -356,7 +354,7 @@ meta_getnmentbydev( nm.key = MD_KEYWILD; nm.major = meta_getmajor(dev); nm.mnum = meta_getminor(dev); - nm.devname = (uint64_t)device_name; + nm.devname = (uintptr_t)device_name; if (metaioctl(MD_IOCGET_NM, &nm, &nm.mde, NULL) != 0) { (void) mdstealerror(ep, &nm.mde); @@ -750,16 +748,16 @@ add_self_name( * The valid qualified name */ if (metaislocalset(sp)) { - len = strlen(p) + strlen("/dev/md/dsk/") + 1; - devname = Malloc(len); - (void) strcpy(devname, "/dev/md/dsk/"); - (void) strcat(devname, p); + len = strlen(p) + strlen("/dev/md/dsk/") + 1; + devname = Malloc(len); + (void) strcpy(devname, "/dev/md/dsk/"); + (void) strcat(devname, p); } else { - len = strlen(sp->setname) + strlen(p) + - strlen("/dev/md//dsk/") + 1; - devname = Malloc(len); - (void) snprintf(devname, len, "/dev/md/%s/dsk/%s", - sp->setname, p); + len = strlen(sp->setname) + strlen(p) + + strlen("/dev/md//dsk/") + 1; + devname = Malloc(len); + (void) snprintf(devname, len, "/dev/md/%s/dsk/%s", + sp->setname, p); } /* @@ -771,11 +769,11 @@ add_self_name( } if (metaislocalset(sp)) { - if ((key = add_name(sp, myside, MD_KEYWILD, drvname, - minor, devname, NULL, NULL, ep)) == MD_KEYBAD) { + if ((key = add_name(sp, myside, MD_KEYWILD, drvname, + minor, devname, NULL, NULL, ep)) == MD_KEYBAD) { Free(devname); return (-1); - } + } } else { /* * Add myside first and use the returned key to add other sides @@ -795,28 +793,29 @@ add_self_name( } if (MD_MNSET_DESC(sd)) { - for (mnside = sd->sd_nodelist; mnside != NULL; - mnside = mnside->nd_next) { - if (mnside->nd_nodeid == myside) - continue; - if (add_name(sp, mnside->nd_nodeid, key, drvname, - minor, devname, NULL, NULL, ep) == -1) { - Free(devname); - return (-1); + for (mnside = sd->sd_nodelist; mnside != NULL; + mnside = mnside->nd_next) { + if (mnside->nd_nodeid == myside) + continue; + if (add_name(sp, mnside->nd_nodeid, key, + drvname, minor, devname, NULL, NULL, + ep) == -1) { + Free(devname); + return (-1); + } } - } } else { - for (side = 0; side < MD_MAXSIDES; side++) { - if (sd->sd_nodes[side][0] == '\0') - continue; - if (side == myside) - continue; - if (add_name(sp, side, key, drvname, minor, devname, - NULL, NULL, ep) == -1) { - Free(devname); - return (-1); + for (side = 0; side < MD_MAXSIDES; side++) { + if (sd->sd_nodes[side][0] == '\0') + continue; + if (side == myside) + continue; + if (add_name(sp, side, key, drvname, minor, + devname, NULL, NULL, ep) == -1) { + Free(devname); + return (-1); + } } - } } } @@ -859,25 +858,26 @@ del_self_name( } if (MD_MNSET_DESC(sd)) { - for (mnside = sd->sd_nodelist; mnside != NULL; - mnside = mnside->nd_next) { - if (mnside->nd_nodeid == myside) - continue; - if ((rval = del_name(sp, mnside->nd_nodeid, key, - ep)) == -1) { - goto out; + for (mnside = sd->sd_nodelist; mnside != NULL; + mnside = mnside->nd_next) { + if (mnside->nd_nodeid == myside) + continue; + if ((rval = del_name(sp, mnside->nd_nodeid, key, + ep)) == -1) { + goto out; + } } - } } else { - for (side = 0; side < MD_MAXSIDES; side++) { - if (sd->sd_nodes[side][0] == '\0') - continue; - if (side == myside) - continue; - if ((rval = del_name(sp, side, key, ep)) == -1) { - goto out; + for (side = 0; side < MD_MAXSIDES; side++) { + if (sd->sd_nodes[side][0] == '\0') + continue; + if (side == myside) + continue; + if ((rval = del_name(sp, side, key, + ep)) == -1) { + goto out; + } } - } } /* diff --git a/usr/src/lib/scsi/libses/Makefile.defs b/usr/src/lib/scsi/libses/Makefile.defs index 9e6d61f601..c4772bd68f 100644 --- a/usr/src/lib/scsi/libses/Makefile.defs +++ b/usr/src/lib/scsi/libses/Makefile.defs @@ -50,10 +50,10 @@ CLEANFILES += \ ../common/ses_errno.c # -# On SPARC, gcc emits DWARF assembler directives for TLS data that are not +# On SPARC, gcc 3.4 emits DWARF assembler directives for TLS data that are not # understood by the Sun assembler. Until this problem is fixed, we turn down # the amount of generated debugging information, which seems to do the trick. # -$(SPARC_BLD)CTF_FLAGS += -_gcc=-g1 +$(__GNUC3)$(SPARC_BLD)CTF_FLAGS += -_gcc=-g1 $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) diff --git a/usr/src/lib/scsi/libsmp/Makefile.com b/usr/src/lib/scsi/libsmp/Makefile.com index 946ce85129..4316313877 100644 --- a/usr/src/lib/scsi/libsmp/Makefile.com +++ b/usr/src/lib/scsi/libsmp/Makefile.com @@ -51,11 +51,11 @@ CLEANFILES += \ ../common/smp_errno.c # -# On SPARC, gcc emits DWARF assembler directives for TLS data that are not +# On SPARC, gcc 3.4 emits DWARF assembler directives for TLS data that are not # understood by the Sun assembler. Until this problem is fixed, we turn down # the amount of generated debugging information, which seems to do the trick. # -$(SPARC_BLD)CTF_FLAGS += -_gcc=-g1 +$(__GNUC3)$(SPARC_BLD)CTF_FLAGS += -_gcc=-g1 $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) diff --git a/usr/src/lib/sun_fc/Makefile.com b/usr/src/lib/sun_fc/Makefile.com index c8dcbe5b80..205fe56f71 100644 --- a/usr/src/lib/sun_fc/Makefile.com +++ b/usr/src/lib/sun_fc/Makefile.com @@ -140,9 +140,8 @@ CPPFLAGS += $(INCS) -DBUILD_TIME='"Wed Sep 24 12:00:00 2008"' LDLIBS += -ldevinfo LDLIBS += -lsysevent LDLIBS += -lnvpair -CCRUNLIBS = -lCstd -lCrun -$(__GNUC)CCRUNLIBS = -lstdc++ -lgcc_s -LDLIBS += $(CCRUNLIBS) +$(__SUNC)CCNEEDED = -lCstd -lCrun +LDLIBS += $(CCNEEDED) LDLIBS += -lc $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) diff --git a/usr/src/lib/sun_fc/amd64/Makefile b/usr/src/lib/sun_fc/amd64/Makefile index d985c6f969..9cd01791ef 100644 --- a/usr/src/lib/sun_fc/amd64/Makefile +++ b/usr/src/lib/sun_fc/amd64/Makefile @@ -27,6 +27,8 @@ include ../Makefile.com include ../../Makefile.lib.64 +$(__SUNC)CCNEEDED = -lCrun -lCstd + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/sun_fc/sparcv9/Makefile b/usr/src/lib/sun_fc/sparcv9/Makefile index d985c6f969..9cd01791ef 100644 --- a/usr/src/lib/sun_fc/sparcv9/Makefile +++ b/usr/src/lib/sun_fc/sparcv9/Makefile @@ -27,6 +27,8 @@ include ../Makefile.com include ../../Makefile.lib.64 +$(__SUNC)CCNEEDED = -lCrun -lCstd + .KEEP_STATE: all: $(LIBS) |