diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-08-31 06:57:27 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-08-31 06:57:27 +0000 |
commit | e4f3bdcf31a8b99f4ad6b7905a396b710bf3b4ee (patch) | |
tree | 9602dcb203eb52d640eca1cf01882c75d1c8cbca /usr.bin | |
parent | 6fc8ef417616624203668f786c1e0d5d02b8353b (diff) |
solaris changes; beck@obtuse
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/sup/src/Makefile.save | 14 | ||||
-rw-r--r-- | usr.bin/sup/src/vprintf.c | 13 |
2 files changed, 22 insertions, 5 deletions
diff --git a/usr.bin/sup/src/Makefile.save b/usr.bin/sup/src/Makefile.save index 2fa0febf8f8..494c1ee1fdb 100644 --- a/usr.bin/sup/src/Makefile.save +++ b/usr.bin/sup/src/Makefile.save @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.save,v 1.2 1996/06/26 05:39:36 deraadt Exp $ +# $OpenBSD: Makefile.save,v 1.3 1997/08/31 06:57:25 deraadt Exp $ # Copyright (c) 1992,1991 Carnegie Mellon University # All Rights Reserved. @@ -45,11 +45,13 @@ SITE = NETBSD #SITE = CMUCS NETBSD_DEFINES = -UMACH -DVAR_TMP -DHAS_DAEMON -DHAS_POSIX_DIR +SOLARIS_DEFINES = -UMACH -DVAR_TMP -DHAS_DAEMON -DHAS_POSIX_DIR -DNEED_VSNPRINTF -DHAS_VFPRINTF AFS_DEFINES = -DAFS -I/usr/afsws/include OSF_DEFINES = -UMACH -DOSF -D_BSD -noshrlib -g -DNEED_VSNPRINTF -DVAR_TMP CMUCS_DEFINES = -DMACH -DDOPRINT_VA -DNEED_VPRINTF NON_MACH_DEFINES = -UMACH #DEFS = -UCMUCS -UCMU ${${SITE}_DEFINES} +#DEFS = -UCMUCS -UCMU ${SOLARIS_DEFINES} DEFS = -UCMUCS -UCMU ${NETBSD_DEFINES} #INSTALLATION PARAMETERS @@ -78,6 +80,7 @@ USE_CRYPT = yes .endif NETBSD_LIBS = -lcrypt -lutil +SOLARIS_LIBS = -lcrypt -lsocket -lnsl CMUCS_LIBS = -lsys OSF_LIBS = -lbsd LIBS = libextra.a @@ -86,6 +89,9 @@ supfilesrv_OFILES = supfilesrv.o scan.o ${SUPS} supfilesrv_LIBS = libextra.a supscan_OFILES = supscan.o stree.o scan.o +OS_LIBS = ${NETBSD_LIBS} +#OS_LIBS = ${SOLARIS_LIBS} + all: ${PROGRAMS} .if defined(USE_CRYPT) @@ -94,13 +100,13 @@ all: ${PROGRAMS} .endif sup: ${sup_OFILES} ${LIBS} - ${CC} ${CFLAGS} -o sup ${sup_OFILES} ${LIBS} ${NETBSD_LIBS} + ${CC} ${CFLAGS} -o sup ${sup_OFILES} ${LIBS} ${OS_LIBS} supfilesrv: ${supfilesrv_OFILES} ${supfilesrv_LIBS} - ${CC} ${CFLAGS} -o supfilesrv ${supfilesrv_OFILES} ${supfilesrv_LIBS} ${NETBSD_LIBS} + ${CC} ${CFLAGS} -o supfilesrv ${supfilesrv_OFILES} ${supfilesrv_LIBS} ${OS_LIBS} supscan: ${supscan_OFILES} ${LIBS} - ${CC} ${CFLAGS} -o supscan ${supscan_OFILES} ${LIBS} ${NETBSD_LIBS} + ${CC} ${CFLAGS} -o supscan ${supscan_OFILES} ${LIBS} ${OS_LIBS} libextra.a: ${EXTRA} ar r libextra.a $? diff --git a/usr.bin/sup/src/vprintf.c b/usr.bin/sup/src/vprintf.c index 4ed153efa47..dc04f46795c 100644 --- a/usr.bin/sup/src/vprintf.c +++ b/usr.bin/sup/src/vprintf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vprintf.c,v 1.3 1997/04/01 07:35:53 todd Exp $ */ +/* $OpenBSD: vprintf.c,v 1.4 1997/08/31 06:57:26 deraadt Exp $ */ /* * Copyright (c) 1991 Carnegie Mellon University @@ -95,16 +95,27 @@ vsnprintf(s, n, fmt, args) va_list args; { FILE fakebuf; +#ifdef HAS_VFPRINTF + int ret; +#endif fakebuf._flag = STRFLAG; fakebuf._ptr = s; fakebuf._cnt = n-1; fakebuf._file = -1; +#ifdef HAS_VFPRINTF + ret = vfprintf(&fakebuf, fmt, args); +#else _doprnt(fmt, args, &fakebuf); fakebuf._cnt++; +#endif putc('\0', &fakebuf); if (fakebuf._cnt<0) fakebuf._cnt = 0; +#ifdef HAS_VFPRINTF + return(ret); +#else return (n-fakebuf._cnt-1); +#endif } #endif /* NEED_VPRINTF || NEED_VSNPRINTF */ |