mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-29 20:04:57 +01:00
Compare commits
16
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
324ec40db3 | ||
|
|
17b0776217 | ||
|
|
8d77b4e304 | ||
|
|
157002a7fa | ||
|
|
4c731d7856 | ||
|
|
1afa50deb4 | ||
|
|
5cc13c0e22 | ||
|
|
9f0dc73359 | ||
|
|
32cd273372 | ||
|
|
92c9323d3b | ||
|
|
01233029ed | ||
|
|
c264e2c65c | ||
|
|
45728f7c5d | ||
|
|
e382a3a979 | ||
|
|
d216e1f6de | ||
|
|
f4856526c7 |
No files matched your search
@@ -13,24 +13,13 @@ committing code that was written by someone else, I decided to use the
|
||||
|
||||
The template looks like this:
|
||||
|
||||
Reviewed by:
|
||||
Submitted by:
|
||||
Obtained from:
|
||||
Reviewed by:
|
||||
Submitted by:
|
||||
CVS: ----------------------------------------------------------------------
|
||||
CVS: Obtained from:
|
||||
CVS: If this change has been taken from another system, such as NetBSD,
|
||||
CVS: then name the system in this line, otherwise delete it.
|
||||
CVS: Reviewed by:
|
||||
CVS: Before committing changes please have someone check your work and
|
||||
CVS: include their name here. If the change is trivial and you have not
|
||||
CVS: had it reviewed then delete this line.
|
||||
CVS: Submitted by:
|
||||
CVS: If this code has been contributed to FreeBSD by someone else; i.e.,
|
||||
CVS: they sent us a patch or a new module, then include their name/email
|
||||
CVS: address here. If this is your work then delete this line.
|
||||
|
||||
(Note that these lines will also automatically removed now if the tags
|
||||
are empty.)
|
||||
CVS: Delete the ``Reviewed by'' line if this is somebody else's work
|
||||
CVS: (you are the reviewer).
|
||||
CVS: Delete the ``Submitted by'' line if this is NOT somebody else's
|
||||
CVS: work (you are the author).
|
||||
|
||||
If you are making substantial or possibly controversial changes to the
|
||||
code, please talk to someone else who either has commit authority, or
|
||||
@@ -53,13 +42,3 @@ so that the logs look cleaner.
|
||||
|
||||
-GAWollman
|
||||
|
||||
|
||||
Importing new stuff is somewhat error-prone since it's easy to create
|
||||
unwanted directories or even whole subtrees without noticing it. The
|
||||
script ``easy-import'' has been created to make first-time imports
|
||||
easier to handle (vendor-branch imports are not yet supported), and to
|
||||
help people avoiding the most common errors. It is available as
|
||||
/usr/local/bin/easy-import on freefall, or in the source tree as
|
||||
src/gnu/usr.bin/cvs/contrib/easy-import.pl.
|
||||
|
||||
Jörg Wunsch
|
||||
@@ -1,29 +1,31 @@
|
||||
# $Id: Makefile,v 1.57.4.18 1996/08/11 03:05:16 rgrimes Exp $
|
||||
#
|
||||
# $Id: Makefile,v 1.29 1994/11/08 00:55:08 ache Exp $
|
||||
#
|
||||
# Make command line options:
|
||||
# -DCLOBBER will remove /usr/include and MOST of /usr/lib
|
||||
# -DCLOBBER will remove /usr/include and MOST of /usr/lib
|
||||
# -DMAKE_LOCAL to add ./local to the SUBDIR list
|
||||
# -DMAKE_PORTS to add ./ports to the SUBDIR list
|
||||
# XXX1 -DMAKE_KERBEROS to build KerberosIV
|
||||
# -DMAKE_EBONES to build eBones (KerberosIV)
|
||||
#
|
||||
# -DNOCLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
|
||||
# -DNOCLEAN to not clean anything at all
|
||||
# -DNOCRYPT will prevent building of crypt versions
|
||||
# -DNOLKM do not build loadable kernel modules
|
||||
# -DNOOBJDIR do not run ``${MAKE} obj''
|
||||
# -DNOPROFILE do not build profiled libraries
|
||||
# -DNOSECURE do not go into secure subdir
|
||||
#
|
||||
#
|
||||
# XXX1 The kerberos IV off the 4.4-Lite tape (src/kerberosIV)
|
||||
# will not build successfully yet. MAKE_KERBEROS should not be
|
||||
# defined.
|
||||
|
||||
# Put initial settings here.
|
||||
SUBDIR=
|
||||
|
||||
# We must do include and lib first so that the perl *.ph generation
|
||||
# works correctly as it uses the header files installed by this.
|
||||
.if exists(include)
|
||||
SUBDIR+= include
|
||||
.endif
|
||||
.if exists(lib)
|
||||
SUBDIR+= lib
|
||||
# Must be first for "distribute" to work
|
||||
.if exists(release)
|
||||
SUBDIR+= release
|
||||
.endif
|
||||
|
||||
.if exists(bin)
|
||||
@@ -38,6 +40,15 @@ SUBDIR+= games
|
||||
.if exists(gnu)
|
||||
SUBDIR+= gnu
|
||||
.endif
|
||||
.if exists(include)
|
||||
SUBDIR+= include
|
||||
.endif
|
||||
.if exists(lib)
|
||||
SUBDIR+= lib
|
||||
.endif
|
||||
.if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS)
|
||||
SUBDIR+= kerberosIV
|
||||
.endif
|
||||
.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
|
||||
SUBDIR+= eBones
|
||||
.endif
|
||||
@@ -86,33 +97,26 @@ OBJDIR=
|
||||
.else
|
||||
OBJDIR= obj
|
||||
.endif
|
||||
|
||||
.if defined(NOCLEAN)
|
||||
CLEANDIR=
|
||||
WORLD_CLEANDIST=obj
|
||||
.else
|
||||
WORLD_CLEANDIST=cleandist
|
||||
.if defined(NOCLEANDIR)
|
||||
CLEANDIR= clean
|
||||
.else
|
||||
.else
|
||||
CLEANDIR= cleandir
|
||||
.endif
|
||||
.endif
|
||||
|
||||
world: hierarchy mk $(WORLD_CLEANDIST) include-tools includes lib-tools libraries build-tools
|
||||
world: hierarchy cleandist mk includes libraries tools
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding ${DESTDIR} The whole thing"
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo
|
||||
${MAKE} depend all install
|
||||
cd ${.CURDIR}/share/man && ${MAKE} makedb
|
||||
@echo "make world completed on `date`"
|
||||
|
||||
|
||||
hierarchy:
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Making hierarchy"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}/etc && ${MAKE} distrib-dirs
|
||||
cd ${.CURDIR}/release && ${MAKE} hierarchy
|
||||
|
||||
update:
|
||||
.if defined(SUP_UPDATE)
|
||||
@@ -120,12 +124,6 @@ update:
|
||||
@echo "Running sup"
|
||||
@echo "--------------------------------------------------------------"
|
||||
@sup -v ${SUPFILE}
|
||||
.if defined(SUPFILE1)
|
||||
@sup -v ${SUPFILE1}
|
||||
.endif
|
||||
.if defined(SUPFILE2)
|
||||
@sup -v ${SUPFILE2}
|
||||
.endif
|
||||
.endif
|
||||
.if defined(CVS_UPDATE)
|
||||
@echo "--------------------------------------------------------------"
|
||||
@@ -171,7 +169,6 @@ installmost:
|
||||
cd ${.CURDIR}/usr.sbin && ${MAKE} ${.MAKEFLAGS} install
|
||||
cd ${.CURDIR}/gnu/libexec && ${MAKE} ${.MAKEFLAGS} install
|
||||
cd ${.CURDIR}/gnu/usr.bin && ${MAKE} ${.MAKEFLAGS} install
|
||||
cd ${.CURDIR}/gnu/usr.sbin && ${MAKE} ${.MAKEFLAGS} install
|
||||
#.if defined(MAKE_EBONES) && !defined(NOCRYPT)
|
||||
# cd ${.CURDIR}/eBones && ${MAKE} ${.MAKEFLAGS} installmost
|
||||
#.endif
|
||||
@@ -190,7 +187,6 @@ most:
|
||||
cd ${.CURDIR}/usr.sbin && ${MAKE} ${.MAKEFLAGS} all
|
||||
cd ${.CURDIR}/gnu/libexec && ${MAKE} ${.MAKEFLAGS} all
|
||||
cd ${.CURDIR}/gnu/usr.bin && ${MAKE} ${.MAKEFLAGS} all
|
||||
cd ${.CURDIR}/gnu/usr.sbin && ${MAKE} ${.MAKEFLAGS} all
|
||||
#.if defined(MAKE_EBONES) && !defined(NOCRYPT)
|
||||
# cd ${.CURDIR}/eBones && ${MAKE} ${.MAKEFLAGS} most
|
||||
#.endif
|
||||
@@ -210,69 +206,33 @@ includes:
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo
|
||||
.if defined(CLOBBER)
|
||||
rm -rf ${DESTDIR}/usr/include/*
|
||||
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
||||
-p ${DESTDIR}/usr/include
|
||||
rm -rf ${DESTDIR}/usr/include
|
||||
mkdir ${DESTDIR}/usr/include
|
||||
chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include
|
||||
chmod 755 ${DESTDIR}/usr/include
|
||||
.endif
|
||||
cd ${.CURDIR}/include && ${MAKE} install
|
||||
cd ${.CURDIR}/gnu/include && ${MAKE} install
|
||||
cd ${.CURDIR}/gnu/lib/libdialog && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libg++ && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libgmp && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libmp && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libreadline && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libregex && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libg++ && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libdialog && ${MAKE} beforeinstall
|
||||
.if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS)
|
||||
cd ${.CURDIR}/kerberosIV/include && ${MAKE} install
|
||||
.endif
|
||||
.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
|
||||
cd ${.CURDIR}/eBones/include && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/eBones/lib/libkrb && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/eBones/lib/libkadm && ${MAKE} beforeinstall
|
||||
.endif
|
||||
cd ${.CURDIR}/lib/csu/${MACHINE} && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libc && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libcurses && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libdisk && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libedit && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libftpio && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libmd && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libmytinfo && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libncurses && ${MAKE} beforeinstall
|
||||
.if !defined(WANT_CSRG_LIBM)
|
||||
.if defined(WANT_MSUN)
|
||||
cd ${.CURDIR}/lib/msun && ${MAKE} beforeinstall
|
||||
.endif
|
||||
cd ${.CURDIR}/lib/libpcap && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/librpcsvc && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libskey && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libtermcap && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libcom_err && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libss && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libscsi && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libutil && ${MAKE} beforeinstall
|
||||
.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
|
||||
cd ${.CURDIR}/secure/lib/libdes && ${MAKE} beforeinstall
|
||||
.endif
|
||||
|
||||
lib-tools:
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding tools needed to build the libraries"
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo
|
||||
cd ${.CURDIR}/usr.bin/xinstall && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/gnu/usr.bin/ld && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/ar && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/ranlib && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/nm && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/lex/lib && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/compile_et && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR} && \
|
||||
rm -f /usr/sbin/compile_et
|
||||
cd ${.CURDIR}/usr.bin/mk_cmds && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
|
||||
libraries:
|
||||
@echo "--------------------------------------------------------------"
|
||||
@@ -283,69 +243,51 @@ libraries:
|
||||
find ${DESTDIR}/usr/lib \! -name '*.s[ao].*' -a \! -type d | \
|
||||
xargs rm -rf
|
||||
.endif
|
||||
.if exists(lib/libcompat)
|
||||
cd ${.CURDIR}/lib/libcompat && \
|
||||
${MAKE} depend all install
|
||||
.endif
|
||||
.if exists(lib/libncurses)
|
||||
cd ${.CURDIR}/lib/libncurses && \
|
||||
${MAKE} depend all install
|
||||
.endif
|
||||
.if exists(lib/libtermcap)
|
||||
cd ${.CURDIR}/lib/libtermcap && \
|
||||
${MAKE} depend all install
|
||||
cd ${.CURDIR}/gnu/lib && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/gnu/usr.bin/cc/libgcc && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
|
||||
cd ${.CURDIR}/secure/lib && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(lib)
|
||||
cd ${.CURDIR}/lib/csu/i386 && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/lib && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(gnu)
|
||||
cd ${.CURDIR}/gnu/lib && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/gnu/usr.bin/cc/libgcc && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(secure) && !defined(NOCRYPT) && !defined(NOSECURE)
|
||||
cd ${.CURDIR}/secure/lib && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
cd ${.CURDIR}/usr.bin/lex/lib && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
.if exists(kerberosIV) && !defined(NOCRYPT) && defined(MAKE_KERBEROS)
|
||||
cd ${.CURDIR}/kerberosIV/acl && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/kerberosIV/des && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/kerberosIV/kdb && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/kerberosIV/krb && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
|
||||
cd ${.CURDIR}/eBones/lib && \
|
||||
cd ${.CURDIR}/eBones/des && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/eBones/acl && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/eBones/kdb && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/eBones/krb && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
.if exists(usr.sbin/pcvt/keycap)
|
||||
cd ${.CURDIR}/usr.sbin/pcvt/keycap && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
.endif
|
||||
|
||||
include-tools:
|
||||
tools:
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding tools needed to build the includes"
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo
|
||||
cd ${.CURDIR}/usr.bin/xinstall && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
|
||||
build-tools:
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding ${DESTDIR} C compiler, make, sgmlfmt, and zic(8)"
|
||||
@echo " Rebuilding ${DESTDIR} Compiler and Make"
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo
|
||||
cd ${.CURDIR}/gnu/usr.bin/cc && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/make && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/sgmlfmt && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/share/sgml && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/gnu/usr.bin/groff && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.sbin/zic && \
|
||||
${MAKE} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
@@ -1,9 +1,9 @@
|
||||
; $Id: TODO,v 1.12 1995/04/23 21:34:23 paul Exp $
|
||||
; $Id: TODO,v 1.4 1994/09/11 20:01:03 phk Exp $
|
||||
|
||||
** To skip this preamble, search forward for the pattern `**'.
|
||||
|
||||
This file contains a list of ideas that people have come up for "good
|
||||
things to do" in FreeBSD. These aren't necessarily things on the
|
||||
things to do" in FreeBSD 2.0. These aren't necessarily things on the
|
||||
fast-track, and in fact consist mostly of things that the core team is
|
||||
never going to find the time to do so, if most things here are going
|
||||
to happen at all, they'll happen when someone reading this list steps
|
||||
@@ -13,7 +13,7 @@ That said, a lot of these ideas would be very nice to have and would
|
||||
add substantially to the perceived value of FreeBSD. Some items on
|
||||
this list would add a LOT of value, for that matter, and are by no
|
||||
means trivial. Take and fix an item with a (*) next to it and WC will
|
||||
even send you a free CD for your troubles! It's the least they
|
||||
even send you a free 2.0 CD for your troubles! It's the least they
|
||||
can do for all notable contributors.
|
||||
|
||||
This is a also good place to look if you're keen for a little
|
||||
@@ -40,8 +40,8 @@ If you start working on something from this list, we also suggest that
|
||||
you contact the email-address listed for more information and to
|
||||
provide some central coordination for your effort. If the email
|
||||
address given is simply <foo> then the email address can be presumed
|
||||
to be <foo@FreeBSD.ORG>. If no email address is listed, then
|
||||
simply send to <freebsd-hackers@FreeBSD.org>.
|
||||
to be <foo@freefall.cdrom.com>. If no email address is listed, then
|
||||
simply send to <freebsd-hackers@freefall.cdrom.com>.
|
||||
|
||||
Thanks!
|
||||
|
||||
@@ -49,12 +49,30 @@ Thanks!
|
||||
|
||||
** --- cut here ---
|
||||
|
||||
TASKID: 940820001
|
||||
TASK: Add interupts to pas.c
|
||||
DETAIL: { You'll need a manual for the ncr-5380 chip and possibly some
|
||||
doc on the PAS16. Linux/NetBSD also have existing drivers to study. }
|
||||
EMAIL: <phk>
|
||||
CATS: kernel scsi
|
||||
GRADE: ADVANCED
|
||||
STATUS: OPEN
|
||||
|
||||
TASKID: 940820002
|
||||
TASK: Add Linux/Crynwr compatible plip mode to lpt.c
|
||||
DETAIL: { Use IF_LLC0 as mode-flag. Look at the crynwr packet-driver
|
||||
plip.asm (ftp::ftp.ftp.com) and the linux driver for reference. }
|
||||
EMAIL: <phk>
|
||||
CATS: kernel networking
|
||||
GRADE: ADVANCED
|
||||
STATUS: OPEN (*)
|
||||
|
||||
TASKID: 940820003
|
||||
TASK: Add laptop-feature to wd.c
|
||||
DETAIL: { If disk just spun up, do sync when we have it running. Need
|
||||
to detect that disk was turned off, e.g. had a long delay in becomming
|
||||
ready again. }
|
||||
EMAIL: <phk, nate>
|
||||
EMAIL: <phk>
|
||||
CATS: kernel laptop
|
||||
GRADE: INTERMEDIATE
|
||||
STATUS: OPEN
|
||||
@@ -67,10 +85,29 @@ also requires some modification of existing drivers to support being used
|
||||
by PCMCIA cards. This task is both really hard and comparatively easy;
|
||||
hard because it's a big job, easy because others have already gone much of
|
||||
the way and you have their work for reference. }
|
||||
EMAIL: <phk, nate>
|
||||
EMAIL: <jkh>
|
||||
CATS: kernel laptop
|
||||
GRADE: ADVANCED
|
||||
STATUS: IN PROGRESS
|
||||
STATUS: OPEN (*)
|
||||
|
||||
TASKID: 940820005
|
||||
TASK: Salvage seagate.c driver from 1.1.5.1
|
||||
DETAIL: { We've got a seagate driver that could use a little cleanup and
|
||||
migration effort }
|
||||
EMAIL: <jkh>
|
||||
CATS: kernel scsi
|
||||
GRADE: BEGINNER
|
||||
STATUS: OPEN
|
||||
|
||||
TASKID: 940820006
|
||||
TASK: Add bootp/DHCP to the generic ethernet code.
|
||||
DETAIL: { Implement an ioctl(), which will send a bootp on a particular
|
||||
interface and return the data in a usable format. OR make a program which uses
|
||||
existing ioctls to do it. See RFC153[34] for information on DHCP. }
|
||||
EMAIL: <phk>
|
||||
CATS: kernel networking
|
||||
GRADE: ADVANCED
|
||||
STATUS: OPEN (*)
|
||||
|
||||
TASKID: 940820007
|
||||
TASK: Add bootp/DHCP capability to slip driver.
|
||||
@@ -81,6 +118,16 @@ CATS: kernel networking
|
||||
GRADE: ADVANCED
|
||||
STATUS: OPEN (*)
|
||||
|
||||
TASKID: 940820009
|
||||
TASK: Make a freebsd.com MS-DOS boot program
|
||||
DETAIL: { This program should be able to boot like the boot-blocks, that is
|
||||
find a FreeBSD-partition and load the kernel from there, but it should
|
||||
also be able to load the kernel from an optional MS-DOS file. }
|
||||
EMAIL: <phk>
|
||||
CATS: kernel DOS
|
||||
GRADE: ADVANCED
|
||||
STATUS: OPEN (*)
|
||||
|
||||
TASKID: 940820010
|
||||
TASK: Make iostat find the disks
|
||||
DETAIL: { This is actually mostly a change to the device-drivers to collect
|
||||
@@ -109,7 +156,7 @@ best accomplish the task. }
|
||||
EMAIL: <jkh>
|
||||
CATS: user
|
||||
GRADE: INTERMEDIATE
|
||||
STATUS: CLOSED - PENDING DOC
|
||||
STATUS: OPEN
|
||||
|
||||
TASKID: 940911001
|
||||
TASK: Make PAS16 a controller.
|
||||
@@ -119,14 +166,3 @@ EMAIL: <phk>
|
||||
CATS: kernel
|
||||
GRADE: INTERMEDIATE
|
||||
STATUS: OPEN
|
||||
|
||||
TASKID: 950222001
|
||||
TASK: Make find smarter about -fstype local
|
||||
DETAIL: { Currently when doing a find blah -fstype local the find traverses
|
||||
through all nfs mounted file systems looking for locally mounted filesystems,
|
||||
this could be short circuited by using getmntinfo/statfs. Note that you
|
||||
can not do this when following symlinks. }
|
||||
EMAIL: <rgrimes, phk>
|
||||
CATS: user
|
||||
GRADE: INTERMEDIATE
|
||||
STATUS: OPEN
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
# From: @(#)Makefile 8.1 (Berkeley) 5/31/93
|
||||
# $Id: Makefile,v 1.2 1994/09/18 21:25:26 wollman Exp $
|
||||
# $Id$
|
||||
|
||||
SUBDIR= cat chmod cp csh date dd df domainname echo ed expr hostname \
|
||||
kill ln ls mkdir mv pax ps pwd rcp rm rmail rmdir sh sleep \
|
||||
|
||||
@@ -1,15 +1,4 @@
|
||||
# @(#)Makefile.inc 8.1 (Berkeley) 5/31/93
|
||||
# $Id: Makefile.inc,v 1.7 1996/09/22 21:51:04 wosch Exp $
|
||||
|
||||
BINDIR?= /bin
|
||||
NOSHARED?= YES
|
||||
|
||||
.if exists (${.CURDIR}/../../secure)
|
||||
|
||||
.if exists(${.CURDIR}/../../secure/lib/libcipher/obj)
|
||||
CIPHEROBJDIR= ${.CURDIR}/../../secure/lib/libcipher/obj
|
||||
.else
|
||||
CIPHEROBJDIR= ${.CURDIR}/../../secure/lib/libcipher
|
||||
.endif
|
||||
|
||||
.endif
|
||||
+2
-7
@@ -33,7 +33,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: cat.c,v 1.3 1995/10/03 12:46:37 bde Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -128,7 +128,6 @@ cook_args(argv)
|
||||
fp = stdin;
|
||||
else if ((fp = fopen(*argv, "r")) == NULL) {
|
||||
warn("%s", *argv);
|
||||
rval = 1;
|
||||
++argv;
|
||||
continue;
|
||||
}
|
||||
@@ -197,7 +196,6 @@ cook_buf(fp)
|
||||
}
|
||||
if (ferror(fp)) {
|
||||
warn("%s", filename);
|
||||
rval = 1;
|
||||
clearerr(fp);
|
||||
}
|
||||
if (ferror(stdout))
|
||||
@@ -218,7 +216,6 @@ raw_args(argv)
|
||||
fd = fileno(stdin);
|
||||
else if ((fd = open(*argv, O_RDONLY, 0)) < 0) {
|
||||
warn("%s", *argv);
|
||||
rval = 1;
|
||||
++argv;
|
||||
continue;
|
||||
}
|
||||
@@ -251,8 +248,6 @@ raw_cat(rfd)
|
||||
for (off = 0; nr; nr -= nw, off += nw)
|
||||
if ((nw = write(wfd, buf + off, nr)) < 0)
|
||||
err(1, "stdout");
|
||||
if (nr < 0) {
|
||||
if (nr < 0)
|
||||
warn("%s", filename);
|
||||
rval = 1;
|
||||
}
|
||||
}
|
||||
+1
-2
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)chmod.1 8.4 (Berkeley) 3/31/94
|
||||
.\" $Id: chmod.1,v 1.2 1994/09/24 02:53:37 davidg Exp $
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd March 31, 1994
|
||||
.Dt CHMOD 1
|
||||
@@ -274,7 +274,6 @@ There's no
|
||||
.Ar perm
|
||||
option for the naughty bits.
|
||||
.Sh SEE ALSO
|
||||
.Xr chflags 1 ,
|
||||
.Xr install 1 ,
|
||||
.Xr chmod 2 ,
|
||||
.Xr stat 2 ,
|
||||
|
||||
+1
-4
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: chmod.c,v 1.3 1995/02/03 22:21:09 bde Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -49,7 +49,6 @@ static char sccsid[] = "@(#)chmod.c 8.8 (Berkeley) 4/1/94";
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <fts.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -70,8 +69,6 @@ main(argc, argv)
|
||||
int Hflag, Lflag, Pflag, Rflag, ch, fflag, fts_options, hflag, rval;
|
||||
char *ep, *mode;
|
||||
|
||||
set = NULL;
|
||||
omode = 0;
|
||||
Hflag = Lflag = Pflag = Rflag = fflag = hflag = 0;
|
||||
while ((ch = getopt(argc, argv, "HLPRXfgorstuwx")) != EOF)
|
||||
switch (ch) {
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)cp.1 8.3 (Berkeley) 4/18/94
|
||||
.\" $Id: cp.1,v 1.2 1994/09/24 02:53:40 davidg Exp $
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd April 18, 1994
|
||||
.Dt CP 1
|
||||
|
||||
+37
-36
@@ -33,7 +33,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: cp.c,v 1.6 1995/05/30 00:06:21 rgrimes Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -48,11 +48,11 @@ static char sccsid[] = "@(#)cp.c 8.2 (Berkeley) 4/1/94";
|
||||
|
||||
/*
|
||||
* Cp copies source files to target files.
|
||||
*
|
||||
*
|
||||
* The global PATH_T structure "to" always contains the path to the
|
||||
* current target file. Since fts(3) does not change directories,
|
||||
* this path can be either absolute or dot-realative.
|
||||
*
|
||||
*
|
||||
* The basic algorithm is to initialize "to" and use fts(3) to traverse
|
||||
* the file hierarchy rooted in the argument list. A trivial case is the
|
||||
* case of 'cp file1 file2'. The more interesting case is the case of
|
||||
@@ -79,7 +79,7 @@ static char sccsid[] = "@(#)cp.c 8.2 (Berkeley) 4/1/94";
|
||||
#include "extern.h"
|
||||
|
||||
#define STRIP_TRAILING_SLASH(p) { \
|
||||
while ((p).p_end > (p).p_path + 1 && (p).p_end[-1] == '/') \
|
||||
while ((p).p_end > (p).p_path && (p).p_end[-1] == '/') \
|
||||
*--(p).p_end = 0; \
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ main(argc, argv)
|
||||
char *target;
|
||||
|
||||
Hflag = Lflag = Pflag = Rflag = 0;
|
||||
while ((ch = getopt(argc, argv, "HLPRfipr")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "HLPRfipr")) != EOF)
|
||||
switch (ch) {
|
||||
case 'H':
|
||||
Hflag = 1;
|
||||
@@ -188,8 +188,8 @@ main(argc, argv)
|
||||
to.target_end = to.p_end;
|
||||
|
||||
/* Set end of argument list for fts(3). */
|
||||
argv[argc] = NULL;
|
||||
|
||||
argv[argc] = NULL;
|
||||
|
||||
/*
|
||||
* Cp has two distinct cases:
|
||||
*
|
||||
@@ -210,7 +210,7 @@ main(argc, argv)
|
||||
if (r == -1 || !S_ISDIR(to_stat.st_mode)) {
|
||||
/*
|
||||
* Case (1). Target is not a directory.
|
||||
*/
|
||||
*/
|
||||
if (argc > 1) {
|
||||
usage();
|
||||
exit(1);
|
||||
@@ -227,7 +227,7 @@ main(argc, argv)
|
||||
stat(*argv, &tmp_stat);
|
||||
else
|
||||
lstat(*argv, &tmp_stat);
|
||||
|
||||
|
||||
if (S_ISDIR(tmp_stat.st_mode) && (Rflag || rflag))
|
||||
type = DIR_TO_DNE;
|
||||
else
|
||||
@@ -253,7 +253,7 @@ copy(argv, type, fts_options)
|
||||
FTS *ftsp;
|
||||
FTSENT *curr;
|
||||
int base, dne, nlen, rval;
|
||||
char *p, *target_mid;
|
||||
char *p;
|
||||
|
||||
if ((ftsp = fts_open(argv, fts_options, mastercmp)) == NULL)
|
||||
err(1, NULL);
|
||||
@@ -274,10 +274,18 @@ copy(argv, type, fts_options)
|
||||
}
|
||||
|
||||
/*
|
||||
* If we are in case (2) or (3) above, we need to append the
|
||||
* source name to the target name.
|
||||
* If we are in case (2) or (3) above, we need to append the
|
||||
* source name to the target name.
|
||||
*/
|
||||
if (type != FILE_TO_FILE) {
|
||||
if ((curr->fts_namelen +
|
||||
to.target_end - to.p_path + 1) > MAXPATHLEN) {
|
||||
warnx("%s/%s: name too long (not copied)",
|
||||
to.p_path, curr->fts_name);
|
||||
rval = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Need to remember the roots of traversals to create
|
||||
* correct pathnames. If there's a directory being
|
||||
@@ -300,29 +308,24 @@ copy(argv, type, fts_options)
|
||||
if (curr->fts_level == FTS_ROOTLEVEL)
|
||||
if (type != DIR_TO_DNE) {
|
||||
p = strrchr(curr->fts_path, '/');
|
||||
base = (p == NULL) ? 0 :
|
||||
base = (p == NULL) ? 0 :
|
||||
(int)(p - curr->fts_path + 1);
|
||||
|
||||
if (!strcmp(&curr->fts_path[base],
|
||||
if (!strcmp(&curr->fts_path[base],
|
||||
".."))
|
||||
base += 1;
|
||||
} else
|
||||
base = curr->fts_pathlen;
|
||||
|
||||
if (to.target_end[-1] != '/') {
|
||||
*to.target_end = '/';
|
||||
*(to.target_end + 1) = 0;
|
||||
}
|
||||
p = &curr->fts_path[base];
|
||||
nlen = curr->fts_pathlen - base;
|
||||
target_mid = to.target_end;
|
||||
if (*p != '/' && target_mid[-1] != '/')
|
||||
*target_mid++ = '/';
|
||||
*target_mid = 0;
|
||||
if (target_mid - to.p_path + nlen > MAXPATHLEN) {
|
||||
warnx("%s%s: name too long (not copied)",
|
||||
to.p_path, p);
|
||||
rval = 1;
|
||||
continue;
|
||||
}
|
||||
(void)strncat(target_mid, p, nlen);
|
||||
to.p_end = target_mid + nlen;
|
||||
|
||||
(void)strncat(to.target_end + 1, p, nlen);
|
||||
to.p_end = to.target_end + nlen + 1;
|
||||
*to.p_end = 0;
|
||||
STRIP_TRAILING_SLASH(to);
|
||||
}
|
||||
@@ -365,23 +368,23 @@ copy(argv, type, fts_options)
|
||||
* umask blocks owner writes, we fail..
|
||||
*/
|
||||
if (dne) {
|
||||
if (mkdir(to.p_path,
|
||||
if (mkdir(to.p_path,
|
||||
curr->fts_statp->st_mode | S_IRWXU) < 0)
|
||||
err(1, "%s", to.p_path);
|
||||
} else if (!S_ISDIR(to_stat.st_mode)) {
|
||||
errno = ENOTDIR;
|
||||
err(1, "%s", to.p_path);
|
||||
err(1, "%s: %s", to.p_path);
|
||||
}
|
||||
/*
|
||||
* If not -p and directory didn't exist, set it to be
|
||||
* the same as the from directory, umodified by the
|
||||
* umask; arguably wrong, but it's been that way
|
||||
* the same as the from directory, umodified by the
|
||||
* umask; arguably wrong, but it's been that way
|
||||
* forever.
|
||||
*/
|
||||
if (pflag && setfile(curr->fts_statp, 0))
|
||||
rval = 1;
|
||||
else if (dne)
|
||||
(void)chmod(to.p_path,
|
||||
(void)chmod(to.p_path,
|
||||
curr->fts_statp->st_mode);
|
||||
break;
|
||||
case S_IFBLK:
|
||||
@@ -389,19 +392,17 @@ copy(argv, type, fts_options)
|
||||
if (Rflag) {
|
||||
if (copy_special(curr->fts_statp, !dne))
|
||||
rval = 1;
|
||||
} else {
|
||||
} else
|
||||
if (copy_file(curr, dne))
|
||||
rval = 1;
|
||||
}
|
||||
break;
|
||||
case S_IFIFO:
|
||||
if (Rflag) {
|
||||
if (Rflag)
|
||||
if (copy_fifo(curr->fts_statp, !dne))
|
||||
rval = 1;
|
||||
} else {
|
||||
else
|
||||
if (copy_file(curr, dne))
|
||||
rval = 1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (copy_file(curr, dne))
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)extern.h 8.2 (Berkeley) 4/1/94
|
||||
* $Id: extern.h,v 1.2 1994/09/24 02:53:41 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
|
||||
+10
-10
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: utils.c,v 1.3.4.2 1995/10/05 07:24:24 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -64,7 +64,7 @@ copy_file(entp, dne)
|
||||
#ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED
|
||||
char *p;
|
||||
#endif
|
||||
|
||||
|
||||
if ((from_fd = open(entp->fts_path, O_RDONLY, 0)) == -1) {
|
||||
warn("%s", entp->fts_path);
|
||||
return (1);
|
||||
@@ -143,12 +143,13 @@ copy_file(entp, dne)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Don't remove the target even after an error. The target might
|
||||
* not be a regular file, or its attributes might be important,
|
||||
* or its contents might be irreplacable. It would only be safe
|
||||
* to remove it if we created it and its length is 0.
|
||||
*/
|
||||
/* If the copy went bad, lose the file. */
|
||||
if (rval == 1) {
|
||||
(void)unlink(to.p_path);
|
||||
(void)close(from_fd);
|
||||
(void)close(to_fd);
|
||||
return (1);
|
||||
}
|
||||
|
||||
if (pflag && setfile(fs, to_fd))
|
||||
rval = 1;
|
||||
@@ -241,8 +242,7 @@ setfile(fs, fd)
|
||||
int rval;
|
||||
|
||||
rval = 0;
|
||||
fs->st_mode &= S_ISUID | S_ISGID | S_ISVTX |
|
||||
S_IRWXU | S_IRWXG | S_IRWXO;
|
||||
fs->st_mode &= S_ISUID | S_ISGID | S_IRWXU | S_IRWXG | S_IRWXO;
|
||||
|
||||
TIMESPEC_TO_TIMEVAL(&tv[0], &fs->st_atimespec);
|
||||
TIMESPEC_TO_TIMEVAL(&tv[1], &fs->st_mtimespec);
|
||||
|
||||
+2
-3
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: alloc.c,v 1.3 1995/03/19 13:28:10 joerg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -122,6 +122,5 @@ showall(v, t)
|
||||
{
|
||||
memtop = (char *) sbrk(0);
|
||||
(void) fprintf(cshout, "Allocated memory from 0x%lx to 0x%lx (%ld).\n",
|
||||
(unsigned long) membot, (unsigned long) memtop,
|
||||
(unsigned long) (memtop - membot));
|
||||
(unsigned long) membot, (unsigned long) memtop, memtop - membot);
|
||||
}
|
||||
+5
-5
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: const.c,v 1.3 1995/05/30 00:06:29 rgrimes Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -72,7 +72,7 @@ Char STRcent2[] = { '%', '%', '\0' };
|
||||
Char STRcenthash[] = { '%', '#', '\0' };
|
||||
Char STRcentplus[] = { '%', '+', '\0' };
|
||||
Char STRcentminus[] = { '%', '-', '\0' };
|
||||
Char STRchase_symlinks[] = { 'c', 'h', 'a', 's', 'e', '_', 's', 'y', 'm', 'l',
|
||||
Char STRchase_symlinks[] = { 'c', 'h', 'a', 's', 'e', '_', 's', 'y', 'm', 'l',
|
||||
'i', 'n', 'k', 's', '\0' };
|
||||
Char STRchild[] = { 'c', 'h', 'i', 'l', 'd', '\0' };
|
||||
Char STRcolon[] = { ':', '\0' };
|
||||
@@ -90,7 +90,7 @@ Char STRfignore[] = { 'f', 'i', 'g', 'n', 'o', 'r', 'e', '\0' };
|
||||
Char STRfilec[] = { 'f', 'i', 'l', 'e', 'c', '\0' };
|
||||
#endif /* FILEC */
|
||||
Char STRhistchars[] = { 'h', 'i', 's', 't', 'c', 'h', 'a', 'r', 's', '\0' };
|
||||
Char STRtildothist[] = { '~', '/', '.', 'h', 'i', 's', 't', 'o', 'r',
|
||||
Char STRtildothist[] = { '~', '/', '.', 'h', 'i', 's', 't', 'o', 'r',
|
||||
'y', '\0' };
|
||||
Char STRhistfile[] = { 'h', 'i', 's', 't', 'f', 'i', 'l', 'e', '\0' };
|
||||
Char STRhistory[] = { 'h', 'i', 's', 't', 'o', 'r', 'y', '\0' };
|
||||
@@ -109,7 +109,7 @@ Char STRml[] = { '-', 'l', '\0' };
|
||||
Char STRmn[] = { '-', 'n', '\0' };
|
||||
Char STRmquestion[] = { '?' | QUOTE, ' ', '\0' };
|
||||
Char STRnice[] = { 'n', 'i', 'c', 'e', '\0' };
|
||||
Char STRnoambiguous[] = { 'n', 'o', 'a', 'm', 'b', 'i', 'g', 'u', 'o', 'u',
|
||||
Char STRnoambiguous[] = { 'n', 'o', 'a', 'm', 'b', 'i', 'g', 'u', 'o', 'u',
|
||||
's', '\0' };
|
||||
Char STRnobeep[] = { 'n', 'o', 'b', 'e', 'e', 'p', '\0' };
|
||||
Char STRnoclobber[] = { 'n', 'o', 'c', 'l', 'o', 'b', 'b', 'e', 'r', '\0' };
|
||||
@@ -121,7 +121,7 @@ Char STRnotify[] = { 'n', 'o', 't', 'i', 'f', 'y', '\0' };
|
||||
Char STRor[] = { '|', '\0' };
|
||||
Char STRor2[] = { '|', '|', '\0' };
|
||||
Char STRpath[] = { 'p', 'a', 't', 'h', '\0' };
|
||||
Char STRprintexitvalue[] = { 'p', 'r', 'i', 'n', 't', 'e', 'x', 'i', 't', 'v',
|
||||
Char STRprintexitvalue[] = { 'p', 'r', 'i', 'n', 't', 'e', 'x', 'i', 't', 'v',
|
||||
'a', 'l', 'u', 'e', '\0' };
|
||||
Char STRprompt[] = { 'p', 'r', 'o', 'm', 'p', 't', '\0' };
|
||||
Char STRprompt2[] = { 'p', 'r', 'o', 'm', 'p', 't', '2', '\0' };
|
||||
|
||||
+2
-11
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)csh.1 8.2 (Berkeley) 1/21/94
|
||||
.\" $Id: csh.1,v 1.3 1995/05/06 13:52:29 ache Exp $
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd January 21, 1994
|
||||
.Dt CSH 1
|
||||
@@ -40,7 +40,7 @@
|
||||
.Nd a shell (command interpreter) with C-like syntax
|
||||
.Sh SYNOPSIS
|
||||
.Nm csh
|
||||
.Op Fl bcefimnstvVxX
|
||||
.Op Fl bcefinstvVxX
|
||||
.Op arg ...
|
||||
.Nm csh
|
||||
.Op Fl l
|
||||
@@ -96,14 +96,6 @@ and outputs are terminals.
|
||||
The shell is a login shell (only applicable if
|
||||
.Fl l
|
||||
is the only flag specified).
|
||||
.It Fl m
|
||||
The shell loads
|
||||
.Pa .cshrc
|
||||
even if it does not belong to the effective user.
|
||||
.Xr su 1
|
||||
can pass
|
||||
.Fl m
|
||||
to the shell.
|
||||
.It Fl n
|
||||
Commands are parsed, but not executed.
|
||||
This aids in syntactic checking of shell scripts.
|
||||
@@ -2115,7 +2107,6 @@ To detect looping, the shell restricts the number of
|
||||
substitutions on a single line to 20.
|
||||
.Sh SEE ALSO
|
||||
.Xr sh 1 ,
|
||||
.Xr su 1 ,
|
||||
.Xr access 2 ,
|
||||
.Xr execve 2 ,
|
||||
.Xr fork 2 ,
|
||||
|
||||
+16
-19
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: csh.c,v 1.3.4.1 1995/08/25 02:55:47 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -248,6 +248,14 @@ main(argc, argv)
|
||||
if ((tcp = getenv("TERM")) != NULL)
|
||||
set(STRterm, SAVE(tcp));
|
||||
|
||||
/*
|
||||
* Re-initialize path if set in environment
|
||||
*/
|
||||
if ((tcp = getenv("PATH")) == NULL)
|
||||
set1(STRpath, defaultpath(), &shvhed);
|
||||
else
|
||||
importpath(SAVE(tcp));
|
||||
|
||||
set(STRshell, Strsave(STR_SHELLPATH));
|
||||
|
||||
doldol = putn((int) getpid()); /* For $$ */
|
||||
@@ -409,16 +417,6 @@ main(argc, argv)
|
||||
stderror(ERR_SYSTEM, "csh", strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Re-initialize path if set in environment
|
||||
* importpath uses intty and intact
|
||||
*/
|
||||
if ((tcp = getenv("PATH")) == NULL)
|
||||
set1(STRpath, defaultpath(), &shvhed);
|
||||
else
|
||||
importpath(SAVE(tcp));
|
||||
|
||||
/*
|
||||
* Decide whether we should play with signals or not. If we are explicitly
|
||||
* told (via -i, or -) or we are a login shell (arg0 starts with -) or the
|
||||
@@ -620,8 +618,7 @@ importpath(cp)
|
||||
for (;;) {
|
||||
if ((c = *dp) == ':' || c == 0) {
|
||||
*dp = 0;
|
||||
if (*cp != '/' && (euid == 0 || uid == 0) &&
|
||||
(intact || intty && isatty(SHOUT)))
|
||||
if ((*cp != '/' || *cp == '\0') && (euid == 0 || uid == 0))
|
||||
(void) fprintf(csherr,
|
||||
"Warning: imported path contains relative components\n");
|
||||
pv[i++] = Strsave(*cp ? cp : STRdot);
|
||||
@@ -812,7 +809,7 @@ rechist()
|
||||
(void) Strcat(buf, STRsldthist);
|
||||
}
|
||||
|
||||
if ((fp = creat(short2str(hfile), 0600)) == -1)
|
||||
if ((fp = creat(short2str(hfile), 0600)) == -1)
|
||||
return;
|
||||
|
||||
oldidfds = didfds;
|
||||
@@ -876,14 +873,14 @@ int sig;
|
||||
|
||||
/*
|
||||
* We kill the last foreground process group. It then becomes
|
||||
* responsible to propagate the SIGHUP to its progeny.
|
||||
* responsible to propagate the SIGHUP to its progeny.
|
||||
*/
|
||||
{
|
||||
struct process *pp, *np;
|
||||
|
||||
for (pp = proclist.p_next; pp; pp = pp->p_next) {
|
||||
np = pp;
|
||||
/*
|
||||
/*
|
||||
* Find if this job is in the foreground. It could be that
|
||||
* the process leader has exited and the foreground flag
|
||||
* is cleared for it.
|
||||
@@ -891,7 +888,7 @@ int sig;
|
||||
do
|
||||
/*
|
||||
* If a process is in the foreground; we try to kill
|
||||
* it's process group. If we succeed, then the
|
||||
* it's process group. If we succeed, then the
|
||||
* whole job is gone. Otherwise we keep going...
|
||||
* But avoid sending HUP to the shell again.
|
||||
*/
|
||||
@@ -1270,9 +1267,9 @@ vis_fputc(ch, fp)
|
||||
{
|
||||
char uenc[5]; /* 4 + NULL */
|
||||
|
||||
if (ch & QUOTE)
|
||||
if (ch & QUOTE)
|
||||
return fputc(ch & TRIM, fp);
|
||||
/*
|
||||
/*
|
||||
* XXX: When we are in AsciiOnly we want all characters >= 0200 to
|
||||
* be encoded, but currently there is no way in vis to do that.
|
||||
*/
|
||||
|
||||
+3
-3
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: dir.c,v 1.3 1995/05/30 00:06:30 rgrimes Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -84,7 +84,7 @@ dinit(hp)
|
||||
/* Don't believe the login shell home, because it may be a symlink */
|
||||
tcp = getwd(path); /* see ngetwd.c for System V version */
|
||||
if (tcp == NULL || *tcp == '\0') {
|
||||
(void) fprintf(csherr, "csh: %s: %s\n", path, strerror(errno));
|
||||
(void) fprintf(csherr, "csh: %s\n", path);
|
||||
if (hp && *hp) {
|
||||
tcp = short2str(hp);
|
||||
if (chdir(tcp) == -1)
|
||||
@@ -221,7 +221,7 @@ printdirs()
|
||||
}
|
||||
if (!(dirflag & DIR_LONG) && hp != NULL && !eq(hp, STRslash) &&
|
||||
(len = Strlen(hp), Strncmp(hp, dp->di_name, len) == 0) &&
|
||||
(dp->di_name[len] == '\0' || dp->di_name[len] == '/'))
|
||||
(dp->di_name[len] == '\0' || dp->di_name[len] == '/'))
|
||||
len = Strlen(s = (dp->di_name + len)) + 2;
|
||||
else
|
||||
len = Strlen(s = dp->di_name) + 1;
|
||||
|
||||
+7
-7
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: dol.c,v 1.2 1994/09/24 02:53:56 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -425,7 +425,7 @@ Dgetdol()
|
||||
if (dimen || bitset)
|
||||
stderror(ERR_SYNTAX);
|
||||
if (backpid != 0) {
|
||||
if (dolbang)
|
||||
if (dolbang)
|
||||
xfree((ptr_t) dolbang);
|
||||
setDolp(dolbang = putn(backpid));
|
||||
}
|
||||
@@ -645,13 +645,13 @@ fixDolMod()
|
||||
dolwcnt = 10000;
|
||||
c = DgetC(0);
|
||||
}
|
||||
if ((c == 'g' && dolmcnt != 10000) ||
|
||||
if ((c == 'g' && dolmcnt != 10000) ||
|
||||
(c == 'a' && dolwcnt != 10000)) {
|
||||
if (c == 'g')
|
||||
dolmcnt = 10000;
|
||||
else
|
||||
dolwcnt = 10000;
|
||||
c = DgetC(0);
|
||||
c = DgetC(0);
|
||||
}
|
||||
|
||||
if (c == 's') { /* [eichin:19910926.0755EST] */
|
||||
@@ -659,12 +659,12 @@ fixDolMod()
|
||||
int delim = DgetC(0);
|
||||
dolmod[dolnmod++] = c;
|
||||
dolmod[dolnmod++] = delim;
|
||||
|
||||
|
||||
if (!delim || letter(delim)
|
||||
|| Isdigit(delim) || any(" \t\n", delim)) {
|
||||
seterror(ERR_BADSUBST);
|
||||
break;
|
||||
}
|
||||
}
|
||||
while ((c = DgetC(0)) != (-1)) {
|
||||
dolmod[dolnmod++] = c;
|
||||
if(c == delim) delimcnt--;
|
||||
@@ -708,7 +708,7 @@ setDolp(cp)
|
||||
Char *lhsub, *rhsub, *np;
|
||||
size_t lhlen = 0, rhlen = 0;
|
||||
int didmod = 0;
|
||||
|
||||
|
||||
delim = dolmod[++i];
|
||||
if (!delim || letter(delim)
|
||||
|| Isdigit(delim) || any(" \t\n", delim)) {
|
||||
|
||||
+7
-14
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: exec.c,v 1.3 1995/05/30 00:06:32 rgrimes Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -50,7 +50,7 @@ static char sccsid[] = "@(#)exec.c 8.1 (Berkeley) 5/31/93";
|
||||
# include <stdarg.h>
|
||||
#else
|
||||
# include <varargs.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "csh.h"
|
||||
#include "extern.h"
|
||||
@@ -656,7 +656,7 @@ tellmewhat(lex)
|
||||
register struct biltins *bptr;
|
||||
register struct wordent *sp = lex->next;
|
||||
bool aliased = 0;
|
||||
Char *s0, *s1, *s2, *cmd;
|
||||
Char *s0, *s1, *s2;
|
||||
Char qc;
|
||||
|
||||
if (adrof1(sp->word, &aliases)) {
|
||||
@@ -696,15 +696,13 @@ tellmewhat(lex)
|
||||
if (eq(sp->word, str2short(bptr->bname))) {
|
||||
if (aliased)
|
||||
prlex(cshout, lex);
|
||||
(void) fprintf(cshout, "%s: shell built-in command.\n",
|
||||
(void) fprintf(cshout, "%s: shell built-in command.\n",
|
||||
vis_str(sp->word));
|
||||
sp->word = s0; /* we save and then restore this */
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
sp->word = cmd = globone(sp->word, G_IGNORE);
|
||||
|
||||
if ((i = iscommand(strip(sp->word))) != 0) {
|
||||
register Char **pv;
|
||||
register struct varent *v;
|
||||
@@ -719,14 +717,10 @@ tellmewhat(lex)
|
||||
while (--i)
|
||||
pv++;
|
||||
if (pv[0][0] == 0 || eq(pv[0], STRdot)) {
|
||||
if (!slash) {
|
||||
sp->word = Strspl(STRdotsl, sp->word);
|
||||
prlex(cshout, lex);
|
||||
xfree((ptr_t) sp->word);
|
||||
} else
|
||||
prlex(cshout, lex);
|
||||
sp->word = Strspl(STRdotsl, sp->word);
|
||||
prlex(cshout, lex);
|
||||
xfree((ptr_t) sp->word);
|
||||
sp->word = s0; /* we save and then restore this */
|
||||
xfree((ptr_t) cmd);
|
||||
return;
|
||||
}
|
||||
s1 = Strspl(*pv, STRslash);
|
||||
@@ -740,6 +734,5 @@ tellmewhat(lex)
|
||||
prlex(cshout, lex);
|
||||
(void) fprintf(csherr, "%s: Command not found.\n", vis_str(sp->word));
|
||||
}
|
||||
xfree((ptr_t) cmd);
|
||||
sp->word = s0; /* we save and then restore this */
|
||||
}
|
||||
+6
-6
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: file.c,v 1.3 1995/05/30 00:06:33 rgrimes Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -112,14 +112,14 @@ static void
|
||||
setup_tty(on)
|
||||
int on;
|
||||
{
|
||||
struct termios tchars;
|
||||
static struct termios tchars;
|
||||
|
||||
(void) tcgetattr(SHIN, &tchars);
|
||||
|
||||
if (on) {
|
||||
tchars.c_cc[VEOL] = ESC;
|
||||
if (tchars.c_lflag & ICANON)
|
||||
on = TCSADRAIN;
|
||||
on = TCSANOW;
|
||||
else {
|
||||
on = TCSAFLUSH;
|
||||
tchars.c_lflag |= ICANON;
|
||||
@@ -127,10 +127,10 @@ setup_tty(on)
|
||||
}
|
||||
else {
|
||||
tchars.c_cc[VEOL] = _POSIX_VDISABLE;
|
||||
on = TCSADRAIN;
|
||||
on = TCSANOW;
|
||||
}
|
||||
|
||||
(void) tcsetattr(SHIN, on, &tchars);
|
||||
(void) tcsetattr(SHIN, TCSANOW, &tchars);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -521,7 +521,7 @@ again: /* search for matches */
|
||||
return (numitems);
|
||||
}
|
||||
else { /* LIST */
|
||||
qsort((ptr_t) items, numitems, sizeof(items[0]),
|
||||
qsort((ptr_t) items, numitems, sizeof(items[0]),
|
||||
(int (*) __P((const void *, const void *))) sortscmp);
|
||||
print_by_column(looking_for_lognames ? NULL : tilded_dir,
|
||||
items, numitems);
|
||||
|
||||
+3
-3
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: func.c,v 1.3 1995/05/30 00:06:34 rgrimes Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -860,12 +860,12 @@ wfree()
|
||||
if (wp->w_end.type != I_SEEK && wp->w_start.type == wp->w_end.type &&
|
||||
wp->w_start.type == o.type) {
|
||||
if (wp->w_end.type == F_SEEK) {
|
||||
if (o.f_seek >= wp->w_start.f_seek &&
|
||||
if (o.f_seek >= wp->w_start.f_seek &&
|
||||
(wp->w_end.f_seek == 0 || o.f_seek < wp->w_end.f_seek))
|
||||
break;
|
||||
}
|
||||
else {
|
||||
if (o.a_seek >= wp->w_start.a_seek &&
|
||||
if (o.a_seek >= wp->w_start.a_seek &&
|
||||
(wp->w_end.a_seek == 0 || o.a_seek < wp->w_end.a_seek))
|
||||
break;
|
||||
}
|
||||
|
||||
+5
-5
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: glob.c,v 1.2 1994/09/24 02:54:05 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -574,7 +574,7 @@ tglob(t)
|
||||
*/
|
||||
if (c == '`') {
|
||||
gflag |= G_CSH;
|
||||
while (*p && *p != '`')
|
||||
while (*p && *p != '`')
|
||||
if (*p++ == '\\') {
|
||||
if (*p) /* Quoted chars */
|
||||
p++;
|
||||
@@ -806,7 +806,7 @@ pword()
|
||||
pnleft = MAXPATHLEN - 4;
|
||||
}
|
||||
|
||||
int
|
||||
int
|
||||
Gmatch(string, pattern)
|
||||
Char *string, *pattern;
|
||||
{
|
||||
@@ -829,7 +829,7 @@ Gmatch(string, pattern)
|
||||
|
||||
blkfree(blk);
|
||||
return(gres == gpol);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
pmatch(string, pattern)
|
||||
@@ -870,7 +870,7 @@ pmatch(string, pattern)
|
||||
(*(pattern-2) & TRIM) <= stringc);
|
||||
pattern++;
|
||||
}
|
||||
else
|
||||
else
|
||||
match = (stringc == (rangec & TRIM));
|
||||
}
|
||||
if (rangec == 0)
|
||||
|
||||
+5
-5
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: lex.c,v 1.3 1995/05/30 00:06:35 rgrimes Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -575,12 +575,12 @@ getdol()
|
||||
int delimcnt = 2;
|
||||
int delim = getC(0);
|
||||
*np++ = delim;
|
||||
|
||||
|
||||
if (!delim || letter(delim)
|
||||
|| Isdigit(delim) || any(" \t\n", delim)) {
|
||||
seterror(ERR_BADSUBST);
|
||||
break;
|
||||
}
|
||||
}
|
||||
while ((c = getC(0)) != (-1)) {
|
||||
*np++ = c;
|
||||
if(c == delim) delimcnt--;
|
||||
@@ -877,7 +877,7 @@ dosub(sc, en, global)
|
||||
|
||||
wdp = hp;
|
||||
while (--i >= 0) {
|
||||
register struct wordent *new =
|
||||
register struct wordent *new =
|
||||
(struct wordent *) xcalloc(1, sizeof *wdp);
|
||||
|
||||
new->word = 0;
|
||||
@@ -1187,7 +1187,7 @@ gethent(sc)
|
||||
}
|
||||
np = lhsb;
|
||||
event = 0;
|
||||
while (!cmap(c, _ESC | _META | _QF | _QB) && !any("^$*-%{}:", c)) {
|
||||
while (!cmap(c, _ESC | _META | _QF | _QB) && !any("${}:", c)) {
|
||||
if (event != -1 && Isdigit(c))
|
||||
event = event * 10 + c - '0';
|
||||
else
|
||||
|
||||
+8
-8
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: parse.c,v 1.2 1994/09/24 02:54:11 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -52,19 +52,19 @@ static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 5/31/93";
|
||||
static void asyntax __P((struct wordent *, struct wordent *));
|
||||
static void asyn0 __P((struct wordent *, struct wordent *));
|
||||
static void asyn3 __P((struct wordent *, struct wordent *));
|
||||
static struct wordent
|
||||
static struct wordent
|
||||
*freenod __P((struct wordent *, struct wordent *));
|
||||
static struct command
|
||||
static struct command
|
||||
*syn0 __P((struct wordent *, struct wordent *, int));
|
||||
static struct command
|
||||
static struct command
|
||||
*syn1 __P((struct wordent *, struct wordent *, int));
|
||||
static struct command
|
||||
static struct command
|
||||
*syn1a __P((struct wordent *, struct wordent *, int));
|
||||
static struct command
|
||||
static struct command
|
||||
*syn1b __P((struct wordent *, struct wordent *, int));
|
||||
static struct command
|
||||
static struct command
|
||||
*syn2 __P((struct wordent *, struct wordent *, int));
|
||||
static struct command
|
||||
static struct command
|
||||
*syn3 __P((struct wordent *, struct wordent *, int));
|
||||
|
||||
#define ALEFT 21 /* max of 20 alias expansions */
|
||||
|
||||
+3
-3
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: sem.c,v 1.2 1994/09/24 02:54:15 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -438,7 +438,7 @@ execute(t, wanttty, pipein, pipeout)
|
||||
}
|
||||
/*
|
||||
* Fall through for all breaks from switch
|
||||
*
|
||||
*
|
||||
* If there will be no more executions of this command, flush all file
|
||||
* descriptors. Places that turn on the F_REPEAT bit are responsible for
|
||||
* doing donefds after the last re-execution
|
||||
@@ -476,7 +476,7 @@ int i;
|
||||
*
|
||||
* I don't know what is best to do. I think that Ambiguous is better
|
||||
* than restructuring the command vector, because the user can get
|
||||
* unexpected results. In any case, the command vector restructuring
|
||||
* unexpected results. In any case, the command vector restructuring
|
||||
* code is present and the user can choose it by setting noambiguous
|
||||
*/
|
||||
static Char *
|
||||
|
||||
+2
-3
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: set.c,v 1.3 1995/05/30 00:06:38 rgrimes Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -664,8 +664,7 @@ exportpath(val)
|
||||
"Warning: ridiculously long PATH truncated\n");
|
||||
break;
|
||||
}
|
||||
if (**val != '/' && (euid == 0 || uid == 0) &&
|
||||
(intact || intty && isatty(SHOUT)))
|
||||
if ((**val != '/' || **val == '\0') && (euid == 0 || uid == 0))
|
||||
(void) fprintf(csherr,
|
||||
"Warning: exported path contains relative components.\n");
|
||||
(void) Strcat(exppath, *val++);
|
||||
|
||||
+5
-5
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: str.c,v 1.2 1994/09/24 02:54:18 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -449,21 +449,21 @@ vis_str(cp)
|
||||
|
||||
if (cp == NULL)
|
||||
return (NULL);
|
||||
|
||||
|
||||
for (dp = cp; *dp++;)
|
||||
continue;
|
||||
n = ((dp - cp) << 2) + 1; /* 4 times + NULL */
|
||||
if (dstsize < n) {
|
||||
sdst = (char *) (dstsize ?
|
||||
sdst = (char *) (dstsize ?
|
||||
xrealloc(sdst, (size_t) n * sizeof(char)) :
|
||||
xmalloc((size_t) n * sizeof(char)));
|
||||
dstsize = n;
|
||||
}
|
||||
/*
|
||||
/*
|
||||
* XXX: When we are in AsciiOnly we want all characters >= 0200 to
|
||||
* be encoded, but currently there is no way in vis to do that.
|
||||
*/
|
||||
(void) strvis(sdst, short2str(cp), VIS_NOSLASH);
|
||||
return (sdst);
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: time.c,v 1.4 1995/03/19 13:28:12 joerg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -180,7 +180,7 @@ prusage(r0, r1, e, b)
|
||||
break;
|
||||
|
||||
case 'X': /* (average) shared text size */
|
||||
(void) fprintf(cshout, "%ld", t == 0 ? 0L :
|
||||
(void) fprintf(cshout, "%ld", t == 0 ? 0L :
|
||||
(r1->ru_ixrss - r0->ru_ixrss) / t);
|
||||
break;
|
||||
|
||||
@@ -246,7 +246,7 @@ pdeltat(t1, t0)
|
||||
struct timeval td;
|
||||
|
||||
tvsub(&td, t1, t0);
|
||||
(void) fprintf(cshout, "%ld.%01ld", td.tv_sec, td.tv_usec / 100000L);
|
||||
(void) fprintf(cshout, "%d.%01d", td.tv_sec, td.tv_usec / 100000);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -256,7 +256,7 @@ tvadd(tsum, t0)
|
||||
|
||||
tsum->tv_sec += t0->tv_sec;
|
||||
tsum->tv_usec += t0->tv_usec;
|
||||
if (tsum->tv_usec >= 1000000)
|
||||
if (tsum->tv_usec > 1000000)
|
||||
tsum->tv_sec++, tsum->tv_usec -= 1000000;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)date.1 8.2 (Berkeley) 11/17/93
|
||||
.\" $Id: date.1,v 1.5.4.1 1995/08/28 10:33:04 davidg Exp $
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd November 17, 1993
|
||||
.Dt DATE 1
|
||||
@@ -107,7 +107,7 @@ in the
|
||||
manual page, as well as any arbitrary text.
|
||||
The format string for the default display is:
|
||||
.Bd -literal -offset indent
|
||||
``%+''.
|
||||
``%a %b %e %H:%M:%S %Z %Y%n''.
|
||||
.Ed
|
||||
.Pp
|
||||
If an operand does not have a leading plus sign, it is interpreted as
|
||||
@@ -127,7 +127,7 @@ Hour, a number from 0 to 23.
|
||||
.It Ar mm
|
||||
Minutes, a number from 0 to 59.
|
||||
.It Ar .ss
|
||||
Seconds, a number from 0 to 61 (59 plus a maximum of two leap seconds).
|
||||
Seconds, a number from 0 to 61 (59 plus a a maximum of two leap seconds).
|
||||
.El
|
||||
.Pp
|
||||
Everything but the minutes is optional.
|
||||
|
||||
+16
-19
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: date.c,v 1.4.4.1 1995/08/28 10:31:25 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -76,19 +76,13 @@ main(argc, argv)
|
||||
struct timezone tz;
|
||||
int ch, rflag;
|
||||
char *format, buf[1024];
|
||||
char *endptr;
|
||||
int set_timezone;
|
||||
|
||||
tz.tz_dsttime = tz.tz_minuteswest = 0;
|
||||
rflag = 0;
|
||||
set_timezone = 0;
|
||||
while ((ch = getopt(argc, argv, "d:nr:ut:")) != EOF)
|
||||
switch((char)ch) {
|
||||
case 'd': /* daylight savings time */
|
||||
tz.tz_dsttime = strtol(optarg, &endptr, 10) ? 1 : 0;
|
||||
if (endptr == optarg || *endptr != '\0')
|
||||
usage();
|
||||
set_timezone = 1;
|
||||
tz.tz_dsttime = atoi(optarg) ? 1 : 0;
|
||||
break;
|
||||
case 'n': /* don't set network */
|
||||
nflag = 1;
|
||||
@@ -102,11 +96,11 @@ main(argc, argv)
|
||||
break;
|
||||
case 't': /* minutes west of GMT */
|
||||
/* error check; don't allow "PST" */
|
||||
tz.tz_minuteswest = strtol(optarg, &endptr, 10);
|
||||
if (endptr == optarg || *endptr != '\0')
|
||||
usage();
|
||||
set_timezone = 1;
|
||||
break;
|
||||
if (isdigit(*optarg)) {
|
||||
tz.tz_minuteswest = atoi(optarg);
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
default:
|
||||
usage();
|
||||
}
|
||||
@@ -117,13 +111,14 @@ main(argc, argv)
|
||||
* If -d or -t, set the timezone or daylight savings time; this
|
||||
* doesn't belong here, there kernel should not know about either.
|
||||
*/
|
||||
if (set_timezone && settimeofday((struct timeval *)NULL, &tz))
|
||||
err(1, "settimeofday (timezone)");
|
||||
if ((tz.tz_minuteswest || tz.tz_dsttime) &&
|
||||
settimeofday(NULL, &tz))
|
||||
err(1, "settimeofday");
|
||||
|
||||
if (!rflag && time(&tval) == -1)
|
||||
err(1, "time");
|
||||
|
||||
format = "%+";
|
||||
format = "%a %b %e %H:%M:%S %Z %Y\n";
|
||||
|
||||
/* allow the operands in any order */
|
||||
if (*argv && **argv == '+') {
|
||||
@@ -140,7 +135,7 @@ main(argc, argv)
|
||||
format = *argv + 1;
|
||||
|
||||
(void)strftime(buf, sizeof(buf), format, localtime(&tval));
|
||||
(void)printf("%s\n", buf);
|
||||
(void)printf("%s", buf);
|
||||
exit(retval);
|
||||
}
|
||||
|
||||
@@ -215,8 +210,10 @@ setthetime(p)
|
||||
logwtmp("|", "date", "");
|
||||
tv.tv_sec = tval;
|
||||
tv.tv_usec = 0;
|
||||
if (settimeofday(&tv, (struct timezone *)NULL))
|
||||
err(1, "settimeofday (timeval)");
|
||||
if (settimeofday(&tv, NULL)) {
|
||||
perror("date: settimeofday");
|
||||
exit(1);
|
||||
}
|
||||
logwtmp("{", "date", "");
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: netdate.c,v 1.2 1994/09/24 02:54:38 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -169,7 +169,7 @@ loop:
|
||||
(void)close(s);
|
||||
return (0);
|
||||
default:
|
||||
warnx("wrong ack received from timed: %s",
|
||||
warnx("wrong ack received from timed: %s",
|
||||
tsptype[msg.tsp_type]);
|
||||
timed_ack = -1;
|
||||
break;
|
||||
|
||||
+69
-3
@@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: conv_tab.c,v 1.2 1994/09/24 02:54:47 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -71,10 +71,76 @@ static char sccsid[] = "@(#)conv_tab.c 8.1 (Berkeley) 5/31/93";
|
||||
*/
|
||||
|
||||
/* Lower-case to upper-case */
|
||||
u_char l2u[256];
|
||||
u_char l2u[] = {
|
||||
0000, 0001, 0002, 0003, 0004, 0005, 0006, 0007, /* 0000 */
|
||||
0010, 0011, 0012, 0013, 0014, 0015, 0016, 0017, /* 0010 */
|
||||
0020, 0021, 0022, 0023, 0024, 0025, 0026, 0027, /* 0020 */
|
||||
0030, 0031, 0032, 0033, 0034, 0035, 0036, 0037, /* 0030 */
|
||||
0040, 0041, 0042, 0043, 0044, 0045, 0046, 0047, /* 0040 */
|
||||
0050, 0051, 0052, 0053, 0054, 0055, 0056, 0057, /* 0050 */
|
||||
0060, 0061, 0062, 0063, 0064, 0065, 0066, 0067, /* 0060 */
|
||||
0070, 0071, 0072, 0073, 0074, 0075, 0076, 0077, /* 0070 */
|
||||
0100, 0101, 0102, 0103, 0104, 0105, 0106, 0107, /* 0100 */
|
||||
0110, 0111, 0112, 0113, 0114, 0115, 0116, 0117, /* 0110 */
|
||||
0120, 0121, 0122, 0123, 0124, 0125, 0126, 0127, /* 0120 */
|
||||
0130, 0131, 0132, 0133, 0134, 0135, 0136, 0137, /* 0130 */
|
||||
0140, 0101, 0102, 0103, 0104, 0105, 0106, 0107, /* 0140 */
|
||||
0110, 0111, 0112, 0113, 0114, 0115, 0116, 0117, /* 0150 */
|
||||
0120, 0121, 0122, 0123, 0124, 0125, 0126, 0127, /* 0160 */
|
||||
0130, 0131, 0132, 0173, 0174, 0175, 0176, 0177, /* 0170 */
|
||||
0200, 0201, 0202, 0203, 0204, 0205, 0206, 0207, /* 0200 */
|
||||
0210, 0211, 0212, 0213, 0214, 0215, 0216, 0217, /* 0210 */
|
||||
0220, 0221, 0222, 0223, 0224, 0225, 0226, 0227, /* 0220 */
|
||||
0230, 0231, 0232, 0233, 0234, 0235, 0236, 0237, /* 0230 */
|
||||
0240, 0241, 0242, 0243, 0244, 0245, 0246, 0247, /* 0240 */
|
||||
0250, 0251, 0252, 0253, 0254, 0255, 0256, 0257, /* 0250 */
|
||||
0260, 0261, 0262, 0263, 0264, 0265, 0266, 0267, /* 0260 */
|
||||
0270, 0271, 0272, 0273, 0274, 0275, 0276, 0277, /* 0270 */
|
||||
0300, 0301, 0302, 0303, 0304, 0305, 0306, 0307, /* 0300 */
|
||||
0310, 0311, 0312, 0313, 0314, 0315, 0316, 0317, /* 0310 */
|
||||
0320, 0321, 0322, 0323, 0324, 0325, 0326, 0327, /* 0320 */
|
||||
0330, 0331, 0332, 0333, 0334, 0335, 0336, 0337, /* 0330 */
|
||||
0340, 0341, 0342, 0343, 0344, 0345, 0346, 0347, /* 0340 */
|
||||
0350, 0351, 0352, 0353, 0354, 0355, 0356, 0357, /* 0350 */
|
||||
0360, 0361, 0362, 0363, 0364, 0365, 0366, 0367, /* 0360 */
|
||||
0370, 0371, 0372, 0373, 0374, 0375, 0376, 0377, /* 0370 */
|
||||
};
|
||||
|
||||
/* Upper-case to lower-case */
|
||||
u_char u2l[256];
|
||||
u_char u2l[] = {
|
||||
0000, 0001, 0002, 0003, 0004, 0005, 0006, 0007, /* 0000 */
|
||||
0010, 0011, 0012, 0013, 0014, 0015, 0016, 0017, /* 0010 */
|
||||
0020, 0021, 0022, 0023, 0024, 0025, 0026, 0027, /* 0020 */
|
||||
0030, 0031, 0032, 0033, 0034, 0035, 0036, 0037, /* 0030 */
|
||||
0040, 0041, 0042, 0043, 0044, 0045, 0046, 0047, /* 0040 */
|
||||
0050, 0051, 0052, 0053, 0054, 0055, 0056, 0057, /* 0050 */
|
||||
0060, 0061, 0062, 0063, 0064, 0065, 0066, 0067, /* 0060 */
|
||||
0070, 0071, 0072, 0073, 0074, 0075, 0076, 0077, /* 0070 */
|
||||
0100, 0141, 0142, 0143, 0144, 0145, 0146, 0147, /* 0100 */
|
||||
0150, 0151, 0152, 0153, 0154, 0155, 0156, 0157, /* 0110 */
|
||||
0160, 0161, 0162, 0163, 0164, 0165, 0166, 0167, /* 0120 */
|
||||
0170, 0171, 0172, 0133, 0134, 0135, 0136, 0137, /* 0130 */
|
||||
0140, 0141, 0142, 0143, 0144, 0145, 0146, 0147, /* 0140 */
|
||||
0150, 0151, 0152, 0153, 0154, 0155, 0156, 0157, /* 0150 */
|
||||
0160, 0161, 0162, 0163, 0164, 0165, 0166, 0167, /* 0160 */
|
||||
0170, 0171, 0172, 0173, 0174, 0175, 0176, 0177, /* 0170 */
|
||||
0200, 0201, 0202, 0203, 0204, 0205, 0206, 0207, /* 0200 */
|
||||
0210, 0211, 0212, 0213, 0214, 0215, 0216, 0217, /* 0210 */
|
||||
0220, 0221, 0222, 0223, 0224, 0225, 0226, 0227, /* 0220 */
|
||||
0230, 0231, 0232, 0233, 0234, 0235, 0236, 0237, /* 0230 */
|
||||
0240, 0241, 0242, 0243, 0244, 0245, 0246, 0247, /* 0240 */
|
||||
0250, 0251, 0252, 0253, 0254, 0255, 0256, 0257, /* 0250 */
|
||||
0260, 0261, 0262, 0263, 0264, 0265, 0266, 0267, /* 0260 */
|
||||
0270, 0271, 0272, 0273, 0274, 0275, 0276, 0277, /* 0270 */
|
||||
0300, 0301, 0302, 0303, 0304, 0305, 0306, 0307, /* 0300 */
|
||||
0310, 0311, 0312, 0313, 0314, 0315, 0316, 0317, /* 0310 */
|
||||
0320, 0321, 0322, 0323, 0324, 0325, 0326, 0327, /* 0320 */
|
||||
0330, 0331, 0332, 0333, 0334, 0335, 0336, 0337, /* 0330 */
|
||||
0340, 0341, 0342, 0343, 0344, 0345, 0346, 0347, /* 0340 */
|
||||
0350, 0351, 0352, 0353, 0354, 0355, 0356, 0357, /* 0350 */
|
||||
0360, 0361, 0362, 0363, 0364, 0365, 0366, 0367, /* 0360 */
|
||||
0370, 0371, 0372, 0373, 0374, 0375, 0376, 0377, /* 0370 */
|
||||
};
|
||||
|
||||
/* EBCDIC to ASCII -- 32V compatible. */
|
||||
u_char e2a_32V[] = {
|
||||
|
||||
+6
-20
@@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: dd.c,v 1.4 1995/01/17 23:04:29 ache Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -177,40 +177,26 @@ setup()
|
||||
if (ddflags & (C_LCASE|C_UCASE))
|
||||
if (ddflags & C_ASCII)
|
||||
if (ddflags & C_LCASE) {
|
||||
for (cnt = 0; cnt <= 0377; ++cnt)
|
||||
for (cnt = 0; cnt < 0377; ++cnt)
|
||||
if (isupper(ctab[cnt]))
|
||||
ctab[cnt] = tolower(ctab[cnt]);
|
||||
} else {
|
||||
for (cnt = 0; cnt <= 0377; ++cnt)
|
||||
for (cnt = 0; cnt < 0377; ++cnt)
|
||||
if (islower(ctab[cnt]))
|
||||
ctab[cnt] = toupper(ctab[cnt]);
|
||||
}
|
||||
else if (ddflags & C_EBCDIC)
|
||||
if (ddflags & C_LCASE) {
|
||||
for (cnt = 0; cnt <= 0377; ++cnt)
|
||||
for (cnt = 0; cnt < 0377; ++cnt)
|
||||
if (isupper(cnt))
|
||||
ctab[cnt] = ctab[tolower(cnt)];
|
||||
} else {
|
||||
for (cnt = 0; cnt <= 0377; ++cnt)
|
||||
for (cnt = 0; cnt < 0377; ++cnt)
|
||||
if (islower(cnt))
|
||||
ctab[cnt] = ctab[toupper(cnt)];
|
||||
}
|
||||
else {
|
||||
else
|
||||
ctab = ddflags & C_LCASE ? u2l : l2u;
|
||||
if (ddflags & C_LCASE) {
|
||||
for (cnt = 0; cnt <= 0377; ++cnt)
|
||||
if (isupper(cnt))
|
||||
ctab[cnt] = tolower(cnt);
|
||||
else
|
||||
ctab[cnt] = cnt;
|
||||
} else {
|
||||
for (cnt = 0; cnt <= 0377; ++cnt)
|
||||
if (islower(cnt))
|
||||
ctab[cnt] = toupper(cnt);
|
||||
else
|
||||
ctab[cnt] = cnt;
|
||||
}
|
||||
}
|
||||
(void)time(&st.start); /* Statistics timestamp. */
|
||||
}
|
||||
|
||||
|
||||
+27
-26
@@ -35,7 +35,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: df.c,v 1.7.4.2 1996/06/05 02:35:24 jkh Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -76,30 +76,29 @@ struct typetab {
|
||||
char *str;
|
||||
long types;
|
||||
} typetab[] = {
|
||||
{"ufs", MT(MOUNT_UFS)},
|
||||
{"local", MT_LOCAL},
|
||||
{"all", MT_ALL},
|
||||
{"nfs", MT(MOUNT_NFS)},
|
||||
{"mfs", MT(MOUNT_MFS)},
|
||||
{"lfs", MT(MOUNT_LFS)},
|
||||
{"msdos", MT(MOUNT_MSDOS)},
|
||||
{"fdesc", MT(MOUNT_FDESC)},
|
||||
{"portal", MT(MOUNT_PORTAL)},
|
||||
"ufs", MT(MOUNT_UFS),
|
||||
"local", MT_LOCAL,
|
||||
"all", MT_ALL,
|
||||
"nfs", MT(MOUNT_NFS),
|
||||
"mfs", MT(MOUNT_MFS),
|
||||
"lfs", MT(MOUNT_LFS),
|
||||
"msdos", MT(MOUNT_MSDOS),
|
||||
"fdesc", MT(MOUNT_FDESC),
|
||||
"portal", MT(MOUNT_PORTAL),
|
||||
#if 0
|
||||
/* return fsid of underlying FS */
|
||||
{"lofs", MT(MOUNT_LOFS)},
|
||||
{"null", MT(MOUNT_NULL)},
|
||||
{"umap", MT(MOUNT_UMAP)},
|
||||
"lofs", MT(MOUNT_LOFS),
|
||||
"null", MT(MOUNT_NULL),
|
||||
"umap", MT(MOUNT_UMAP),
|
||||
#endif
|
||||
{"kernfs", MT(MOUNT_KERNFS)},
|
||||
{"procfs", MT(MOUNT_PROCFS)},
|
||||
{"afs", MT(MOUNT_AFS)},
|
||||
{"iso9660fs", MT(MOUNT_CD9660)},
|
||||
{"cdfs", MT(MOUNT_CD9660)},
|
||||
{"misc", MT(MOUNT_LOFS)|MT(MOUNT_FDESC)|MT(MOUNT_PORTAL)|
|
||||
MT(MOUNT_KERNFS)|MT(MOUNT_PROCFS)},
|
||||
{NULL, 0}
|
||||
|
||||
"kernfs", MT(MOUNT_KERNFS),
|
||||
"procfs", MT(MOUNT_PROCFS),
|
||||
"afs", MT(MOUNT_AFS),
|
||||
"iso9660fs", MT(MOUNT_CD9660),
|
||||
"cdfs", MT(MOUNT_CD9660),
|
||||
"misc", MT(MOUNT_LOFS)|MT(MOUNT_FDESC)|MT(MOUNT_PORTAL)|
|
||||
MT(MOUNT_KERNFS)|MT(MOUNT_PROCFS),
|
||||
NULL, 0
|
||||
};
|
||||
|
||||
long addtype __P((long, char *));
|
||||
@@ -125,7 +124,6 @@ main(argc, argv)
|
||||
char *mntpt;
|
||||
|
||||
iflag = nflag = tflag = 0;
|
||||
fsmask = MT_NONE;
|
||||
|
||||
while ((ch = getopt(argc, argv, "iknt:")) != EOF)
|
||||
switch (ch) {
|
||||
@@ -336,7 +334,7 @@ prtstat(sfsp, maxwidth)
|
||||
used = inodes - sfsp->f_ffree;
|
||||
(void)printf(" %7ld %7ld %5.0f%% ", used, sfsp->f_ffree,
|
||||
inodes == 0 ? 100.0 : (double)used / (double)inodes * 100.0);
|
||||
} else
|
||||
} else
|
||||
(void)printf(" ");
|
||||
(void)printf(" %s\n", sfsp->f_mntonname);
|
||||
}
|
||||
@@ -386,7 +384,10 @@ ufs_df(file, maxwidth)
|
||||
sfsp->f_blocks = sblock.fs_dsize;
|
||||
sfsp->f_bfree = sblock.fs_cstotal.cs_nbfree * sblock.fs_frag +
|
||||
sblock.fs_cstotal.cs_nffree;
|
||||
sfsp->f_bavail = freespace(&sblock, sblock.fs_minfree);
|
||||
sfsp->f_bavail = (sblock.fs_dsize * (100 - sblock.fs_minfree) / 100) -
|
||||
(sblock.fs_dsize - sfsp->f_bfree);
|
||||
if (sfsp->f_bavail < 0)
|
||||
sfsp->f_bavail = 0;
|
||||
sfsp->f_files = sblock.fs_ncg * sblock.fs_ipg;
|
||||
sfsp->f_ffree = sblock.fs_cstotal.cs_nifree;
|
||||
sfsp->f_fsid.val[0] = 0;
|
||||
@@ -421,7 +422,7 @@ bread(off, buf, cnt)
|
||||
void
|
||||
usage()
|
||||
{
|
||||
fprintf(stderr,
|
||||
fprintf(stderr,
|
||||
"usage: df [-ikn] [-t fstype] [file | file_system ...]\n");
|
||||
exit(1);
|
||||
}
|
||||
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" From: @(#)hostname.1 8.1 (Berkeley) 5/31/93
|
||||
.\" $Id: domainname.1,v 1.1 1994/09/18 21:23:36 wollman Exp $
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd September 18, 1994
|
||||
.Dt DOMAINNAME 1
|
||||
@@ -55,7 +55,7 @@ domain name does not necessarily have anything to do with the Domain
|
||||
Name System domain name, although they are often set equal for administrative
|
||||
convenience.
|
||||
.Sh SEE ALSO
|
||||
.Xr getdomainname 3
|
||||
.Xr getdomainname 2
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
|
||||
@@ -40,7 +40,7 @@ static char copyright[] =
|
||||
#ifndef lint
|
||||
/*static char sccsid[] = "From: @(#)hostname.c 8.1 (Berkeley) 5/31/93"; */
|
||||
static const char rcsid[] =
|
||||
"$Id: domainname.c,v 1.4 1994/09/26 02:14:27 wollman Exp $";
|
||||
"$Id: domainname.c,v 1.3 1994/09/21 22:30:55 bde Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@@ -56,7 +56,7 @@ main(argc,argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
char domainname[MAXHOSTNAMELEN];
|
||||
char *p, domainname[MAXHOSTNAMELEN];
|
||||
|
||||
argc--, argv++;
|
||||
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)echo.1 8.1 (Berkeley) 7/22/93
|
||||
.\" $Id: echo.1,v 1.2 1994/09/24 02:55:17 davidg Exp $
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd July 22, 1993
|
||||
.Dt ECHO 1
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: echo.c,v 1.2 1994/09/24 02:55:18 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
|
||||
+5
-6
@@ -1,15 +1,14 @@
|
||||
# $Id: Makefile,v 1.13 1995/10/22 20:14:13 ache Exp $
|
||||
# $Id: Makefile,v 1.8 1994/09/24 02:55:20 davidg Exp $
|
||||
|
||||
PROG= ed
|
||||
SRCS= buf.c cbc.c glbl.c io.c main.c re.c sub.c undo.c
|
||||
SRCS= buf.c cbc.c glbl.c io.c main.c re.c sub.c undo.c
|
||||
LINKS= ${BINDIR}/ed ${BINDIR}/red
|
||||
MLINKS= ed.1 red.1
|
||||
|
||||
.if exists(../../secure) && !defined(NOCRYPT) && !defined(NOSECURE)
|
||||
DISTRIBUTION=des
|
||||
.if !defined(NOCRYPT)
|
||||
CFLAGS+=-DDES
|
||||
LDADD+= -L${CIPHEROBJDIR} -lcipher
|
||||
DPADD+= ${CIPHEROBJDIR}/libcipher.a
|
||||
LDADD+= -lcrypt
|
||||
DPADD+= ${LIBCRYPT}
|
||||
.endif
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
+2
-2
@@ -25,7 +25,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: buf.c,v 1.6 1994/09/24 02:55:22 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
#ifndef lint
|
||||
static char *rcsid = "@(#)buf.c,v 1.4 1994/02/01 00:34:35 alm Exp";
|
||||
@@ -253,7 +253,7 @@ init_buffers()
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
/* Read stdin one character at a time to avoid i/o contention
|
||||
/* Read stdin one character at a time to avoid i/o contention
|
||||
with shell escapes invoked by nonterminal input, e.g.,
|
||||
ed - <<EOF
|
||||
!cat
|
||||
|
||||
+2
-8
@@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)bdes.c 5.5 (Berkeley) 6/27/91
|
||||
* $Id: cbc.c,v 1.4 1994/09/24 02:55:24 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -115,7 +115,7 @@ init_des_cipher()
|
||||
|
||||
des_ct = des_n = 0;
|
||||
|
||||
/* initialize the initialization vector */
|
||||
/* initialize the initialization vctor */
|
||||
MEMZERO(ivec, 8);
|
||||
|
||||
/* intialize the padding vector */
|
||||
@@ -137,8 +137,6 @@ get_des_char(fp)
|
||||
des_ct = cbc_decode(des_buf, fp);
|
||||
}
|
||||
return (des_ct > 0) ? des_buf[des_n++] : EOF;
|
||||
#else
|
||||
return (getc(fp));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -155,8 +153,6 @@ put_des_char(c, fp)
|
||||
des_n = 0;
|
||||
}
|
||||
return (des_ct >= 0) ? (des_buf[des_n++] = c) : EOF;
|
||||
#else
|
||||
return (fputc(c, fp));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -172,8 +168,6 @@ flush_des_file(fp)
|
||||
des_n = 0;
|
||||
}
|
||||
return (des_ct >= 0 && cbc_encode(des_buf, des_n, fp) >= 0) ? 0 : EOF;
|
||||
#else
|
||||
return (fflush(fp));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -25,7 +25,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: glbl.c,v 1.3 1995/03/19 13:28:27 joerg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -132,8 +132,8 @@ exec_global(interact, gflag)
|
||||
for (; *ibufp;)
|
||||
if ((status = extract_addr_range()) < 0 ||
|
||||
(status = exec_command()) < 0 ||
|
||||
(status > 0 && (status = display_lines(
|
||||
current_addr, current_addr, status)) < 0))
|
||||
status > 0 && (status = display_lines(
|
||||
current_addr, current_addr, status)) < 0)
|
||||
return status;
|
||||
}
|
||||
return 0;
|
||||
@@ -158,7 +158,7 @@ set_active_node(lp)
|
||||
#if defined(sun) || defined(NO_REALLOC_NULL)
|
||||
if (active_list != NULL) {
|
||||
#endif
|
||||
if ((ts = (line_t **) realloc(active_list,
|
||||
if ((ts = (line_t **) realloc(active_list,
|
||||
(ti += MINBUFSZ) * sizeof(line_t **))) == NULL) {
|
||||
fprintf(stderr, "%s\n", strerror(errno));
|
||||
sprintf(errmsg, "out of memory");
|
||||
@@ -167,7 +167,7 @@ set_active_node(lp)
|
||||
}
|
||||
#if defined(sun) || defined(NO_REALLOC_NULL)
|
||||
} else {
|
||||
if ((ts = (line_t **) malloc((ti += MINBUFSZ) *
|
||||
if ((ts = (line_t **) malloc((ti += MINBUFSZ) *
|
||||
sizeof(line_t **))) == NULL) {
|
||||
fprintf(stderr, "%s\n", strerror(errno));
|
||||
sprintf(errmsg, "out of memory");
|
||||
|
||||
+4
-4
@@ -24,7 +24,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: io.c,v 1.4 1995/03/19 13:28:32 joerg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -106,7 +106,7 @@ read_stream(fp, n)
|
||||
return ERR;
|
||||
if (appended && size && o_isbinary && o_newline_added)
|
||||
fputs("newline inserted\n", stderr);
|
||||
else if (newline_added && (!appended || (!isbinary && !o_isbinary)))
|
||||
else if (newline_added && (!appended || !isbinary && !o_isbinary))
|
||||
fputs("newline appended\n", stderr);
|
||||
if (isbinary && newline_added && !appended)
|
||||
size += 1;
|
||||
@@ -128,8 +128,8 @@ get_stream_line(fp)
|
||||
register int c;
|
||||
register int i = 0;
|
||||
|
||||
while (((c = des ? get_des_char(fp) : getc(fp)) != EOF || (!feof(fp) &&
|
||||
!ferror(fp))) && c != '\n') {
|
||||
while (((c = des ? get_des_char(fp) : getc(fp)) != EOF || !feof(fp) &&
|
||||
!ferror(fp)) && c != '\n') {
|
||||
REALLOC(sbuf, sbufsz, i + 1, ERR);
|
||||
if (!(sbuf[i++] = c))
|
||||
isbinary = 1;
|
||||
|
||||
+22
-22
@@ -25,7 +25,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: main.c,v 1.4 1995/03/19 13:28:34 joerg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -42,7 +42,7 @@ static char *rcsid = "@(#)main.c,v 1.1 1994/02/01 00:34:42 alm Exp";
|
||||
* CREDITS
|
||||
*
|
||||
* This program is based on the editor algorithm described in
|
||||
* Brian W. Kernighan and P. J. Plauger's book "Software Tools
|
||||
* Brian W. Kernighan and P. J. Plauger's book "Software Tools
|
||||
* in Pascal," Addison-Wesley, 1981.
|
||||
*
|
||||
* The buffering algorithm is attributed to Rodney Ruddock of
|
||||
@@ -154,9 +154,9 @@ top:
|
||||
signal(SIGQUIT, SIG_IGN);
|
||||
signal(SIGINT, signal_int);
|
||||
#ifdef _POSIX_SOURCE
|
||||
if ((status = sigsetjmp(env, 1)))
|
||||
if (status = sigsetjmp(env, 1))
|
||||
#else
|
||||
if ((status = setjmp(env)))
|
||||
if (status = setjmp(env))
|
||||
#endif
|
||||
{
|
||||
fputs("\n?\n", stderr);
|
||||
@@ -192,7 +192,7 @@ top:
|
||||
fputs("?\n", stderr);
|
||||
sprintf(errmsg, "warning: file modified");
|
||||
if (!isatty(0)) {
|
||||
fprintf(stderr, garrulous ?
|
||||
fprintf(stderr, garrulous ?
|
||||
"script, line %d: %s\n" :
|
||||
"", lineno, errmsg);
|
||||
quit(2);
|
||||
@@ -213,7 +213,7 @@ top:
|
||||
isglobal = 0;
|
||||
if ((status = extract_addr_range()) >= 0 &&
|
||||
(status = exec_command()) >= 0)
|
||||
if (!status ||
|
||||
if (!status || status &&
|
||||
(status = display_lines(current_addr, current_addr,
|
||||
status)) >= 0)
|
||||
continue;
|
||||
@@ -225,16 +225,16 @@ top:
|
||||
fputs("?\n", stderr); /* give warning */
|
||||
sprintf(errmsg, "warning: file modified");
|
||||
if (!isatty(0)) {
|
||||
fprintf(stderr, garrulous ?
|
||||
"script, line %d: %s\n" :
|
||||
fprintf(stderr, garrulous ?
|
||||
"script, line %d: %s\n" :
|
||||
"", lineno, errmsg);
|
||||
quit(2);
|
||||
}
|
||||
break;
|
||||
case FATAL:
|
||||
if (!isatty(0))
|
||||
fprintf(stderr, garrulous ?
|
||||
"script, line %d: %s\n" : "",
|
||||
fprintf(stderr, garrulous ?
|
||||
"script, line %d: %s\n" : "",
|
||||
lineno, errmsg);
|
||||
else
|
||||
fprintf(stderr, garrulous ? "%s\n" : "",
|
||||
@@ -243,7 +243,7 @@ top:
|
||||
default:
|
||||
fputs("?\n", stderr);
|
||||
if (!isatty(0)) {
|
||||
fprintf(stderr, garrulous ?
|
||||
fprintf(stderr, garrulous ?
|
||||
"script, line %d: %s\n" : "",
|
||||
lineno, errmsg);
|
||||
quit(2);
|
||||
@@ -256,7 +256,7 @@ top:
|
||||
|
||||
long first_addr, second_addr, addr_cnt;
|
||||
|
||||
/* extract_addr_range: get line addresses from the command buffer until an
|
||||
/* extract_addr_range: get line addresses from the command buffer until an
|
||||
illegal address is seen; return status */
|
||||
int
|
||||
extract_addr_range()
|
||||
@@ -544,11 +544,11 @@ exec_command()
|
||||
return ERR;
|
||||
else if (build_active_list(c == 'g' || c == 'G') < 0)
|
||||
return ERR;
|
||||
else if ((n = (c == 'G' || c == 'V')))
|
||||
else if (n = (c == 'G' || c == 'V'))
|
||||
GET_COMMAND_SUFFIX();
|
||||
isglobal++;
|
||||
if (exec_global(n, gflag) < 0)
|
||||
return ERR;
|
||||
return ERR;
|
||||
break;
|
||||
case 'h':
|
||||
if (addr_cnt > 0) {
|
||||
@@ -691,7 +691,7 @@ exec_command()
|
||||
sflags |= SGR;
|
||||
ibufp++;
|
||||
break;
|
||||
case '0': case '1': case '2': case '3': case '4':
|
||||
case '0': case '1': case '2': case '3': case '4':
|
||||
case '5': case '6': case '7': case '8': case '9':
|
||||
STRTOL(sgnum, ibufp);
|
||||
sflags |= SGF;
|
||||
@@ -802,7 +802,7 @@ exec_command()
|
||||
return ERR;
|
||||
}
|
||||
#endif
|
||||
if ((addr = write_file(*fnp ? fnp : old_filename,
|
||||
if ((addr = write_file(*fnp ? fnp : old_filename,
|
||||
(c == 'W') ? "a" : "w", first_addr, second_addr)) < 0)
|
||||
return ERR;
|
||||
else if (addr == addr_last)
|
||||
@@ -840,7 +840,7 @@ exec_command()
|
||||
break;
|
||||
case '=':
|
||||
GET_COMMAND_SUFFIX();
|
||||
printf("%ld\n", addr_cnt ? second_addr : addr_last);
|
||||
printf("%d\n", addr_cnt ? second_addr : addr_last);
|
||||
break;
|
||||
case '!':
|
||||
if (addr_cnt > 0) {
|
||||
@@ -888,7 +888,7 @@ check_addr_range(n, m)
|
||||
}
|
||||
|
||||
|
||||
/* get_matching_node_addr: return the address of the next line matching a
|
||||
/* get_matching_node_addr: return the address of the next line matching a
|
||||
pattern in a given direction. wrap around begin/end of editor buffer if
|
||||
necessary */
|
||||
long
|
||||
@@ -902,7 +902,7 @@ get_matching_node_addr(pat, dir)
|
||||
|
||||
if (!pat) return ERR;
|
||||
do {
|
||||
if ((n = dir ? INC_MOD(n, addr_last) : DEC_MOD(n, addr_last))) {
|
||||
if (n = dir ? INC_MOD(n, addr_last) : DEC_MOD(n, addr_last)) {
|
||||
lp = get_addressed_line_node(n);
|
||||
if ((s = get_sbuf_line(lp)) == NULL)
|
||||
return ERR;
|
||||
@@ -910,7 +910,7 @@ get_matching_node_addr(pat, dir)
|
||||
NUL_TO_NEWLINE(s, lp->len);
|
||||
if (!regexec(pat, s, 0, NULL, 0))
|
||||
return n;
|
||||
}
|
||||
}
|
||||
} while (n != current_addr);
|
||||
sprintf(errmsg, "no match");
|
||||
return ERR;
|
||||
@@ -1148,7 +1148,7 @@ move_lines(addr)
|
||||
REQUE(b2, b1->q_forw);
|
||||
REQUE(a1->q_back, a2);
|
||||
REQUE(b1, a1);
|
||||
current_addr = addr + ((addr < first_addr) ?
|
||||
current_addr = addr + ((addr < first_addr) ?
|
||||
second_addr - first_addr + 1 : 0);
|
||||
}
|
||||
if (isglobal)
|
||||
@@ -1339,7 +1339,7 @@ strip_escapes(s)
|
||||
|
||||
REALLOC(file, filesz, MAXPATHLEN + 1, NULL);
|
||||
/* assert: no trailing escape */
|
||||
while ((file[i++] = (*s == '\\') ? *++s : *s))
|
||||
while (file[i++] = (*s == '\\') ? *++s : *s)
|
||||
s++;
|
||||
return file;
|
||||
}
|
||||
|
||||
+3
-3
@@ -25,7 +25,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: re.c,v 1.9 1995/03/19 13:28:36 joerg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -39,7 +39,7 @@ extern int patlock;
|
||||
|
||||
char errmsg[MAXPATHLEN + 40] = "";
|
||||
|
||||
/* get_compiled_pattern: return pointer to compiled pattern from command
|
||||
/* get_compiled_pattern: return pointer to compiled pattern from command
|
||||
buffer */
|
||||
pattern_t *
|
||||
get_compiled_pattern()
|
||||
@@ -67,7 +67,7 @@ get_compiled_pattern()
|
||||
return NULL;
|
||||
}
|
||||
patlock = 0;
|
||||
if ((n = regcomp(exp, exps, 0))) {
|
||||
if (n = regcomp(exp, exps, 0)) {
|
||||
regerror(n, exp, errmsg, sizeof errmsg);
|
||||
free(exp);
|
||||
return exp = NULL;
|
||||
|
||||
+6
-10
@@ -1,4 +1,4 @@
|
||||
/* sub.c: This file contains the substitution routines for the ed
|
||||
/* sub.c: This file contains the substitution routines for the ed
|
||||
line editor */
|
||||
/*-
|
||||
* Copyright (c) 1993 Andrew Moore, Talke Studio.
|
||||
@@ -25,7 +25,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: sub.c,v 1.5 1995/03/19 13:28:38 joerg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -97,7 +97,7 @@ extract_subst_template()
|
||||
;
|
||||
else if (!isglobal) {
|
||||
while ((n = get_tty_line()) == 0 ||
|
||||
(n > 0 && ibuf[n - 1] != '\n'))
|
||||
n > 0 && ibuf[n - 1] != '\n')
|
||||
clearerr(stdin);
|
||||
if (n < 0)
|
||||
return NULL;
|
||||
@@ -124,7 +124,6 @@ search_and_replace(pat, gflag, kth)
|
||||
char *txt;
|
||||
char *eot;
|
||||
long lc;
|
||||
long xa = current_addr;
|
||||
int nsubs = 0;
|
||||
line_t *lp;
|
||||
int len;
|
||||
@@ -155,10 +154,8 @@ search_and_replace(pat, gflag, kth)
|
||||
} while (txt != eot);
|
||||
SPL0();
|
||||
nsubs++;
|
||||
xa = current_addr;
|
||||
}
|
||||
}
|
||||
current_addr = xa;
|
||||
if (nsubs == 0 && !(gflag & GLB)) {
|
||||
sprintf(errmsg, "no match");
|
||||
return ERR;
|
||||
@@ -188,7 +185,7 @@ substitute_matching_text(pat, lp, gflag, kth)
|
||||
|
||||
if ((txt = get_sbuf_line(lp)) == NULL)
|
||||
return ERR;
|
||||
if (isbinary)
|
||||
if (isbinary)
|
||||
NUL_TO_NEWLINE(txt, lp->len);
|
||||
eot = txt + lp->len;
|
||||
if (!regexec(pat, txt, SE_MAX, rm, 0)) {
|
||||
@@ -213,9 +210,8 @@ substitute_matching_text(pat, lp, gflag, kth)
|
||||
off += i;
|
||||
}
|
||||
txt += rm[0].rm_eo;
|
||||
} while (*txt &&
|
||||
(!changed || ((gflag & GSG) && rm[0].rm_eo)) &&
|
||||
!regexec(pat, txt, SE_MAX, rm, REG_NOTBOL));
|
||||
} while (*txt && (!changed || (gflag & GSG) && rm[0].rm_eo) &&
|
||||
!regexec(pat, txt, SE_MAX, rm, REG_NOTBOL));
|
||||
i = eot - txt;
|
||||
REALLOC(rbuf, rbufsz, off + i + 2, ERR);
|
||||
if (i > 0 && !rm[0].rm_eo && (gflag & GSG)) {
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
# /b/source/CVS/src/bin/expr/Makefile,v 1.5 1993/06/14 19:56:06 jtc Exp
|
||||
# $Id: Makefile,v 1.7 1995/05/30 00:06:49 rgrimes Exp $
|
||||
# $Id$
|
||||
|
||||
PROG= expr
|
||||
SRCS= expr.c
|
||||
SRCS= expr.c
|
||||
CLEANFILES+= expr.c y.tab.h
|
||||
|
||||
expr.c:
|
||||
|
||||
+5
-5
@@ -15,7 +15,7 @@
|
||||
.\" must display the following acknowledgement:
|
||||
.\" This product includes software developed by Winning Strategies, Inc.
|
||||
.\" 4. The name of the author may not be used to endorse or promote products
|
||||
.\" derived from this software without specific prior written permission
|
||||
.\" derived from this software withough specific prior written permission
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
@@ -28,7 +28,7 @@
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $Id: expr.1,v 1.3 1994/04/24 01:18:46 jkh Exp $
|
||||
.\" $Id: expr.1,v 1.2 1993/10/04 22:07:27 jtc Exp $
|
||||
.\"
|
||||
.Dd July 3, 1993
|
||||
.Dt EXPR 1
|
||||
@@ -51,8 +51,8 @@ All operators are separate arguments to the
|
||||
utility.
|
||||
Characters special to the command interpreter must be escaped.
|
||||
.Pp
|
||||
Operators are listed below in order of increasing precedence.
|
||||
Operators with equal precedence are grouped within { } symbols.
|
||||
Operators are listed below in order of increasing precidence.
|
||||
Operators with equal precidence are grouped within { } symbols.
|
||||
.Bl -tag -width indent
|
||||
.It Ar expr1 Li | Ar expr2
|
||||
Returns the evaluation of
|
||||
@@ -66,7 +66,7 @@ Returns the evaluation of
|
||||
if neither expression evaluates to an empty string or zero;
|
||||
otherwise, returns zero.
|
||||
.It Ar expr1 Li "{=, >, >=, <, <=, !=}" Ar expr2
|
||||
Returns the results of integer comparison if both arguments are integers;
|
||||
Returns the results of integer comparision if both arguments are integers;
|
||||
otherwise, returns the results of string comparison using the locale-specific
|
||||
collation sequence.
|
||||
The result of each comparison is 1 if the specified relation is true,
|
||||
|
||||
+32
-43
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* Largely rewritten by J.T. Conklin ([email protected])
|
||||
*
|
||||
* $Id: expr.y,v 1.11 1995/11/18 18:05:03 joerg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <err.h>
|
||||
|
||||
enum valtype {
|
||||
integer, numeric_string, string
|
||||
integer, string
|
||||
} ;
|
||||
|
||||
struct val {
|
||||
@@ -56,6 +56,7 @@ char **av;
|
||||
%left <val> '+' '-'
|
||||
%left <val> '*' '/' '%'
|
||||
%left <val> ':'
|
||||
%left UNARY
|
||||
|
||||
%token <val> TOKEN
|
||||
%type <val> start expr
|
||||
@@ -93,7 +94,7 @@ int i;
|
||||
|
||||
vp = (struct val *) malloc (sizeof (*vp));
|
||||
if (vp == NULL) {
|
||||
errx (2, "malloc() failed");
|
||||
err (2, NULL);
|
||||
}
|
||||
|
||||
vp->type = integer;
|
||||
@@ -106,26 +107,13 @@ make_str (s)
|
||||
char *s;
|
||||
{
|
||||
struct val *vp;
|
||||
int i, isint;
|
||||
|
||||
vp = (struct val *) malloc (sizeof (*vp));
|
||||
if (vp == NULL || ((vp->u.s = strdup (s)) == NULL)) {
|
||||
errx (2, "malloc() failed");
|
||||
err (2, NULL);
|
||||
}
|
||||
|
||||
for(i = 1, isint = isdigit(s[0]) || s[0] == '-';
|
||||
isint && i < strlen(s);
|
||||
i++)
|
||||
{
|
||||
if(!isdigit(s[i]))
|
||||
isint = 0;
|
||||
}
|
||||
|
||||
if (isint)
|
||||
vp->type = numeric_string;
|
||||
else
|
||||
vp->type = string;
|
||||
|
||||
vp->type = string;
|
||||
return vp;
|
||||
}
|
||||
|
||||
@@ -134,7 +122,7 @@ void
|
||||
free_value (vp)
|
||||
struct val *vp;
|
||||
{
|
||||
if (vp->type == string || vp->type == numeric_string)
|
||||
if (vp->type == string)
|
||||
free (vp->u.s);
|
||||
}
|
||||
|
||||
@@ -143,19 +131,34 @@ int
|
||||
to_integer (vp)
|
||||
struct val *vp;
|
||||
{
|
||||
char *s;
|
||||
int neg;
|
||||
int i;
|
||||
|
||||
if (vp->type == integer)
|
||||
return 1;
|
||||
|
||||
if (vp->type == string)
|
||||
return 0;
|
||||
s = vp->u.s;
|
||||
i = 0;
|
||||
|
||||
neg = (*s == '-');
|
||||
if (neg)
|
||||
s++;
|
||||
|
||||
for (;*s; s++) {
|
||||
if (!isdigit (*s))
|
||||
return 0;
|
||||
|
||||
i *= 10;
|
||||
i += *s - '0';
|
||||
}
|
||||
|
||||
/* vp->type == numeric_string, make it numeric */
|
||||
i = atoi(vp->u.s);
|
||||
free (vp->u.s);
|
||||
vp->u.i = i;
|
||||
if (neg)
|
||||
i *= -1;
|
||||
|
||||
vp->type = integer;
|
||||
vp->u.i = i;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -165,12 +168,12 @@ struct val *vp;
|
||||
{
|
||||
char *tmp;
|
||||
|
||||
if (vp->type == string || vp->type == numeric_string)
|
||||
if (vp->type == string)
|
||||
return;
|
||||
|
||||
tmp = malloc (25);
|
||||
if (tmp == NULL) {
|
||||
errx (2, "malloc() failed");
|
||||
err (2, NULL);
|
||||
}
|
||||
|
||||
sprintf (tmp, "%d", vp->u.i);
|
||||
@@ -183,7 +186,6 @@ int
|
||||
isstring (vp)
|
||||
struct val *vp;
|
||||
{
|
||||
/* only TRUE if this string is not a valid integer */
|
||||
return (vp->type == string);
|
||||
}
|
||||
|
||||
@@ -191,6 +193,7 @@ struct val *vp;
|
||||
int
|
||||
yylex ()
|
||||
{
|
||||
struct val *vp;
|
||||
char *p;
|
||||
|
||||
if (*av == NULL)
|
||||
@@ -225,9 +228,7 @@ struct val *vp;
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
int yyparse ();
|
||||
|
||||
int
|
||||
void
|
||||
main (argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
@@ -243,7 +244,7 @@ char **argv;
|
||||
else
|
||||
printf ("%s\n", result->u.s);
|
||||
|
||||
return (is_zero_or_null (result));
|
||||
exit (is_zero_or_null (result));
|
||||
}
|
||||
|
||||
int
|
||||
@@ -292,8 +293,6 @@ struct val *a, *b;
|
||||
to_string (b);
|
||||
r = make_integer (strcoll (a->u.s, b->u.s) == 0);
|
||||
} else {
|
||||
(void)to_integer(a);
|
||||
(void)to_integer(b);
|
||||
r = make_integer (a->u.i == b->u.i);
|
||||
}
|
||||
|
||||
@@ -313,8 +312,6 @@ struct val *a, *b;
|
||||
to_string (b);
|
||||
r = make_integer (strcoll (a->u.s, b->u.s) > 0);
|
||||
} else {
|
||||
(void)to_integer(a);
|
||||
(void)to_integer(b);
|
||||
r= make_integer (a->u.i > b->u.i);
|
||||
}
|
||||
|
||||
@@ -334,8 +331,6 @@ struct val *a, *b;
|
||||
to_string (b);
|
||||
r = make_integer (strcoll (a->u.s, b->u.s) < 0);
|
||||
} else {
|
||||
(void)to_integer(a);
|
||||
(void)to_integer(b);
|
||||
r = make_integer (a->u.i < b->u.i);
|
||||
}
|
||||
|
||||
@@ -355,8 +350,6 @@ struct val *a, *b;
|
||||
to_string (b);
|
||||
r = make_integer (strcoll (a->u.s, b->u.s) >= 0);
|
||||
} else {
|
||||
(void)to_integer(a);
|
||||
(void)to_integer(b);
|
||||
r = make_integer (a->u.i >= b->u.i);
|
||||
}
|
||||
|
||||
@@ -376,8 +369,6 @@ struct val *a, *b;
|
||||
to_string (b);
|
||||
r = make_integer (strcoll (a->u.s, b->u.s) <= 0);
|
||||
} else {
|
||||
(void)to_integer(a);
|
||||
(void)to_integer(b);
|
||||
r = make_integer (a->u.i <= b->u.i);
|
||||
}
|
||||
|
||||
@@ -397,8 +388,6 @@ struct val *a, *b;
|
||||
to_string (b);
|
||||
r = make_integer (strcoll (a->u.s, b->u.s) != 0);
|
||||
} else {
|
||||
(void)to_integer(a);
|
||||
(void)to_integer(b);
|
||||
r = make_integer (a->u.i != b->u.i);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)hostname.1 8.1 (Berkeley) 5/31/93
|
||||
.\" $Id: hostname.1,v 1.2.6.2 1996/06/05 02:35:38 jkh Exp $
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd May 31, 1993
|
||||
.Dt HOSTNAME 1
|
||||
@@ -58,7 +58,7 @@ Trims off any domain information from the printed
|
||||
name.
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr gethostname 3
|
||||
.Xr gethostname 2
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm hostname
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: kill.c,v 1.2 1994/09/24 02:55:44 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -89,7 +89,7 @@ main(argc, argv)
|
||||
numsig = strtol(*argv, &ep, 10);
|
||||
if (!*argv || *ep)
|
||||
errx(1, "illegal signal number: %s", *argv);
|
||||
if (numsig < 0 || numsig > NSIG)
|
||||
if (numsig <= 0 || numsig > NSIG)
|
||||
nosig(*argv);
|
||||
} else
|
||||
nosig(*argv);
|
||||
|
||||
+3
-3
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ln.c,v 1.5 1994/12/06 18:50:44 bde Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -142,9 +142,9 @@ linkit(target, source, isdir)
|
||||
++p;
|
||||
(void)snprintf(path, sizeof(path), "%s/%s", source, p);
|
||||
source = path;
|
||||
exists = !lstat(source, &sb);
|
||||
exists = !stat(source, &sb);
|
||||
} else
|
||||
exists = !lstat(source, &sb);
|
||||
exists = !stat(source, &sb);
|
||||
|
||||
/*
|
||||
* If the file exists, and -f was specified, unlink it.
|
||||
|
||||
+6
-7
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)ls.1 8.6 (Berkeley) 4/18/94
|
||||
.\" $Id: ls.1,v 1.4 1995/09/26 08:48:09 mpp Exp $
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd April 18, 1994
|
||||
.Dt LS 1
|
||||
@@ -82,10 +82,9 @@ Force multi-column output; this is the default when output is to a terminal.
|
||||
Display a slash (/) immediately after each pathname
|
||||
that is a directory, an asterisk (*) after each that is
|
||||
executable,
|
||||
an at sign (@) after each symbolic link,
|
||||
an equals sign (=) after each socket,
|
||||
and a vertical bar (|) after each that is a
|
||||
.Tn FIFO .
|
||||
and an at sign (@) after each symbolic link.
|
||||
.\" and a vertical bar (|) after each that is a
|
||||
.\" .Tn FIFO .
|
||||
.It Fl L
|
||||
If argument is a symbolic link, list the file or directory the link references
|
||||
rather than the link itself.
|
||||
@@ -216,8 +215,8 @@ Directory.
|
||||
Symbolic link.
|
||||
.It Sy s
|
||||
Socket link.
|
||||
.It Sy p
|
||||
.Tn FIFO .
|
||||
.\" .It Sy p
|
||||
.\" .Tn FIFO .
|
||||
.It Sy \-
|
||||
Regular file.
|
||||
.El
|
||||
|
||||
+5
-12
@@ -33,7 +33,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ls.c,v 1.6 1995/03/23 19:05:00 phk Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -114,12 +114,8 @@ main(argc, argv)
|
||||
else
|
||||
termwidth = win.ws_col;
|
||||
f_column = f_nonprint = 1;
|
||||
} else {
|
||||
} else
|
||||
f_singlecol = 1;
|
||||
/* retrieve environment variable, in case of explicit -C */
|
||||
if ((p = getenv("COLUMNS")))
|
||||
termwidth = atoi(p);
|
||||
}
|
||||
|
||||
/* Root is -A automatically. */
|
||||
if (!getuid())
|
||||
@@ -227,12 +223,10 @@ main(argc, argv)
|
||||
|
||||
/* If -l or -s, figure out block size. */
|
||||
if (f_longform || f_size) {
|
||||
(void)getbsize(¬used, &blocksize);
|
||||
blocksize /= 512;
|
||||
if (f_kblocks)
|
||||
blocksize = 2;
|
||||
else {
|
||||
(void)getbsize(¬used, &blocksize);
|
||||
blocksize /= 512;
|
||||
}
|
||||
blocksize *= 2;
|
||||
}
|
||||
|
||||
/* Select a sort function. */
|
||||
@@ -373,7 +367,6 @@ display(p, list)
|
||||
btotal = maxblock = maxinode = maxlen = maxnlink = 0;
|
||||
bcfile = 0;
|
||||
maxuser = maxgroup = maxflags = 0;
|
||||
flags = NULL;
|
||||
maxsize = 0;
|
||||
for (cur = list, entries = 0; cur; cur = cur->fts_link) {
|
||||
if (cur->fts_info == FTS_ERR || cur->fts_info == FTS_NS) {
|
||||
|
||||
+7
-6
@@ -33,7 +33,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: print.c,v 1.4.4.1 1995/08/28 10:30:27 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -52,6 +52,7 @@ static char sccsid[] = "@(#)print.c 8.4 (Berkeley) 4/17/94";
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <tzfile.h>
|
||||
#include <unistd.h>
|
||||
#include <utmp.h>
|
||||
|
||||
@@ -187,7 +188,7 @@ printcol(dp)
|
||||
dp->s_block);
|
||||
if ((base += numrows) >= num)
|
||||
break;
|
||||
while ((cnt = ((chcnt + TAB) & ~(TAB - 1))) <= endcol){
|
||||
while ((cnt = (chcnt + TAB & ~(TAB - 1))) <= endcol) {
|
||||
(void)putchar('\t');
|
||||
chcnt = cnt;
|
||||
}
|
||||
@@ -227,13 +228,13 @@ printtime(ftime)
|
||||
time_t ftime;
|
||||
{
|
||||
int i;
|
||||
char longstring[80];
|
||||
char *longstring;
|
||||
|
||||
strftime(longstring, sizeof(longstring), "%c", localtime(&ftime));
|
||||
longstring = ctime(&ftime);
|
||||
for (i = 4; i < 11; ++i)
|
||||
(void)putchar(longstring[i]);
|
||||
|
||||
#define SIXMONTHS ((365 / 2) * 86400)
|
||||
#define SIXMONTHS ((DAYSPERNYEAR / 2) * SECSPERDAY)
|
||||
if (f_sectime)
|
||||
for (i = 11; i < 24; i++)
|
||||
(void)putchar(longstring[i]);
|
||||
@@ -282,7 +283,7 @@ printlink(p)
|
||||
|
||||
if (p->fts_level == FTS_ROOTLEVEL)
|
||||
(void)snprintf(name, sizeof(name), "%s", p->fts_name);
|
||||
else
|
||||
else
|
||||
(void)snprintf(name, sizeof(name),
|
||||
"%s/%s", p->fts_parent->fts_accpath, p->fts_name);
|
||||
if ((lnklen = readlink(name, path, sizeof(path) - 1)) == -1) {
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: util.c,v 1.4 1994/10/09 15:25:23 ache Exp $
|
||||
* $Id: util.c,v 1.3 1994/09/24 02:55:58 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
|
||||
+2
-2
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)mv.1 8.1 (Berkeley) 5/31/93
|
||||
.\" $Id: mv.1,v 1.2.6.1 1995/08/29 11:14:21 davidg Exp $
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd May 31, 1993
|
||||
.Dt MV 1
|
||||
@@ -112,7 +112,7 @@ to accomplish the move.
|
||||
The effect is equivalent to:
|
||||
.Bd -literal -offset indent
|
||||
rm -f destination_path && \e
|
||||
\tcp -pRP source_file destination && \e
|
||||
\tcp -pr source_file destination && \e
|
||||
\trm -rf source_file
|
||||
.Ed
|
||||
.Pp
|
||||
|
||||
+5
-11
@@ -33,7 +33,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: mv.c,v 1.2.6.1 1995/10/09 05:12:21 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -116,16 +116,10 @@ endarg: argc -= optind;
|
||||
*endp++ = '/';
|
||||
++baselen;
|
||||
for (rval = 0; --argc; ++argv) {
|
||||
/*
|
||||
* Find the last component of the source pathname. It
|
||||
* may have trailing slashes.
|
||||
*/
|
||||
p = *argv + strlen(*argv);
|
||||
while (p != *argv && p[-1] == '/')
|
||||
--p;
|
||||
while (p != *argv && p[-1] != '/')
|
||||
--p;
|
||||
|
||||
if ((p = strrchr(*argv, '/')) == NULL)
|
||||
p = *argv;
|
||||
else
|
||||
++p;
|
||||
if ((baselen + (len = strlen(p))) >= MAXPATHLEN) {
|
||||
warnx("%s: destination pathname too long", *argv);
|
||||
rval = 1;
|
||||
|
||||
+15
-15
@@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ar_io.c,v 1.3 1995/05/30 00:06:52 rgrimes Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -278,7 +278,7 @@ ar_open(name)
|
||||
break;
|
||||
default:
|
||||
/*
|
||||
* should never happen, worse case, slow...
|
||||
* should never happen, worse case, slow...
|
||||
*/
|
||||
blksz = rdblksz = BLKMULT;
|
||||
break;
|
||||
@@ -458,8 +458,8 @@ ar_set_wr()
|
||||
* will stop us if the archive containing the trailer was not written
|
||||
*/
|
||||
wr_trail = 0;
|
||||
|
||||
/*
|
||||
|
||||
/*
|
||||
* Add any device dependent code as required here
|
||||
*/
|
||||
if (artyp != ISREG)
|
||||
@@ -480,7 +480,7 @@ ar_set_wr()
|
||||
/*
|
||||
* ar_app_ok()
|
||||
* check if the last volume in the archive allows appends. We cannot check
|
||||
* this until we are ready to write since there is no spec that says all
|
||||
* this until we are ready to write since there is no spec that says all
|
||||
* volumes in a single archive have to be of the same type...
|
||||
* Return:
|
||||
* 0 if we can append, -1 otherwise.
|
||||
@@ -592,7 +592,7 @@ ar_read(buf, cnt)
|
||||
else
|
||||
warn(0, "End of archive volume %d reached", arvol);
|
||||
return(res);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* ar_write()
|
||||
@@ -710,8 +710,8 @@ ar_write(buf, bsz)
|
||||
warn(1,"Unable to append, trailer re-write failed. Quitting.");
|
||||
return(res);
|
||||
}
|
||||
|
||||
if (res == 0)
|
||||
|
||||
if (res == 0)
|
||||
warn(0, "End of archive volume %d reached", arvol);
|
||||
else if (res < 0)
|
||||
syswarn(1, errno, "Failed write to archive volume: %d", arvol);
|
||||
@@ -791,7 +791,7 @@ ar_rdsync()
|
||||
if ((cpos = lseek(arfd, (off_t)0L, SEEK_CUR)) < 0)
|
||||
break;
|
||||
mpos = fsbz - (cpos % (off_t)fsbz);
|
||||
if (lseek(arfd, mpos, SEEK_CUR) < 0)
|
||||
if (lseek(arfd, mpos, SEEK_CUR) < 0)
|
||||
break;
|
||||
lstrval = 1;
|
||||
break;
|
||||
@@ -850,14 +850,14 @@ ar_fow(sksz, skipped)
|
||||
* number of physical blocks to skip (we do not know physical block
|
||||
* size at this point), so we must only read foward on tapes!
|
||||
*/
|
||||
if (artyp != ISREG)
|
||||
if (artyp != ISREG)
|
||||
return(0);
|
||||
|
||||
/*
|
||||
* figure out where we are in the archive
|
||||
*/
|
||||
if ((cpos = lseek(arfd, (off_t)0L, SEEK_CUR)) >= 0) {
|
||||
/*
|
||||
/*
|
||||
* we can be asked to move farther than there are bytes in this
|
||||
* volume, if so, just go to file end and let normal buf_fill()
|
||||
* deal with the end of file (it will go to next volume by
|
||||
@@ -898,7 +898,7 @@ ar_rev(sksz)
|
||||
{
|
||||
off_t cpos;
|
||||
struct mtop mb;
|
||||
register int phyblk;
|
||||
register int phyblk;
|
||||
|
||||
/*
|
||||
* make sure we do not have try to reverse on a flawed archive
|
||||
@@ -908,7 +908,7 @@ ar_rev(sksz)
|
||||
|
||||
switch(artyp) {
|
||||
case ISPIPE:
|
||||
if (sksz <= 0)
|
||||
if (sksz <= 0)
|
||||
break;
|
||||
/*
|
||||
* cannot go backwards on these critters
|
||||
@@ -1017,7 +1017,7 @@ ar_rev(sksz)
|
||||
/*
|
||||
* get_phys()
|
||||
* Determine the physical block size on a tape drive. We need the physical
|
||||
* block size so we know how many bytes we skip over when we move with
|
||||
* block size so we know how many bytes we skip over when we move with
|
||||
* mtio commands. We also make sure we are BEFORE THE TAPE FILEMARK when
|
||||
* return.
|
||||
* This is one really SLOW routine...
|
||||
@@ -1218,7 +1218,7 @@ ar_next()
|
||||
/*
|
||||
* we are to continue with the same device
|
||||
*/
|
||||
if (ar_open(arcname) >= 0)
|
||||
if (ar_open(arcname) >= 0)
|
||||
return(0);
|
||||
tty_prnt("Cannot re-open %s, try again\n",
|
||||
arcname);
|
||||
|
||||
+10
-10
@@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ar_subs.c,v 1.3 1995/05/30 00:06:52 rgrimes Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -449,7 +449,7 @@ wr_archive(arcn, is_app)
|
||||
if ((res > 0) || (docrc && (set_crc(arcn, fd) < 0))) {
|
||||
/*
|
||||
* unable to obtain the crc we need, close the file,
|
||||
* purge link table entry
|
||||
* purge link table entry
|
||||
*/
|
||||
rdfile_close(arcn, &fd);
|
||||
purg_lnk(arcn);
|
||||
@@ -472,7 +472,7 @@ wr_archive(arcn, is_app)
|
||||
}
|
||||
wr_one = 1;
|
||||
if (res > 0) {
|
||||
/*
|
||||
/*
|
||||
* format write says no file data needs to be stored
|
||||
* so we are done messing with this file
|
||||
*/
|
||||
@@ -535,7 +535,7 @@ wr_archive(arcn, is_app)
|
||||
* is called to add the new members.
|
||||
* PAX IMPLEMENTATION DETAIL NOTE:
|
||||
* -u is implemented by adding the new members to the end of the archive.
|
||||
* Care is taken so that these do not end up as links to the older
|
||||
* Care is taken so that these do not end up as links to the older
|
||||
* version of the same file already stored in the archive. It is expected
|
||||
* when extraction occurs these newer versions will over-write the older
|
||||
* ones stored "earlier" in the archive (this may be a bad assumption as
|
||||
@@ -677,7 +677,7 @@ append()
|
||||
(void)fputs("done.\n", stderr);
|
||||
vfpart = 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* go to the writing phase to add the new members
|
||||
*/
|
||||
@@ -765,7 +765,7 @@ copy()
|
||||
|
||||
/*
|
||||
* start up the hard link table; file traversal routines and the
|
||||
* modification time and access mode database
|
||||
* modification time and access mode database
|
||||
*/
|
||||
if ((lnk_start() < 0) || (ftree_start() < 0) || (dir_start() < 0))
|
||||
return;
|
||||
@@ -881,7 +881,7 @@ copy()
|
||||
* try to create a hard link to the src file if requested
|
||||
* but make sure we are not trying to overwrite ourselves.
|
||||
*/
|
||||
if (lflag)
|
||||
if (lflag)
|
||||
res = cross_lnk(arcn);
|
||||
else
|
||||
res = chk_same(arcn);
|
||||
@@ -988,7 +988,7 @@ next_head(arcn)
|
||||
register int hsz;
|
||||
register int in_resync = 0; /* set when we are in resync mode */
|
||||
int cnt = 0; /* counter for trailer function */
|
||||
|
||||
|
||||
/*
|
||||
* set up initial conditions, we want a whole frmt->hsz block as we
|
||||
* have no data yet.
|
||||
@@ -1132,7 +1132,7 @@ get_arc()
|
||||
register int minhd = BLKMULT;
|
||||
char *hdend;
|
||||
int notice = 0;
|
||||
|
||||
|
||||
/*
|
||||
* find the smallest header size in all archive formats and then set up
|
||||
* to read the archive.
|
||||
@@ -1192,7 +1192,7 @@ get_arc()
|
||||
if ((*fsub[ford[i]].id)(hdbuf, hdsz) < 0)
|
||||
continue;
|
||||
frmt = &(fsub[ford[i]]);
|
||||
/*
|
||||
/*
|
||||
* yuck, to avoid slow special case code in the extract
|
||||
* routines, just push this header back as if it was
|
||||
* not seen. We have left extra space at start of the
|
||||
|
||||
+9
-9
@@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: buf_subs.c,v 1.3 1995/05/30 00:06:53 rgrimes Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -101,7 +101,7 @@ wr_start()
|
||||
* archive that might be hard to read elsewhere. If all ok, we then
|
||||
* open the first archive volume
|
||||
*/
|
||||
if (!wrblksz)
|
||||
if (!wrblksz)
|
||||
wrblksz = frmt->bsz;
|
||||
if (wrblksz > MAXBLK) {
|
||||
warn(1, "Write block size of %d too large, maximium is: %d",
|
||||
@@ -115,7 +115,7 @@ wr_start()
|
||||
}
|
||||
|
||||
/*
|
||||
* we only allow wrblksz to be used with all archive operations
|
||||
* we only allow wrblksz to be used with all archive operations
|
||||
*/
|
||||
blksz = rdblksz = wrblksz;
|
||||
if ((ar_open(arcname) < 0) && (ar_next() < 0))
|
||||
@@ -215,7 +215,7 @@ cp_start()
|
||||
* about the conditions under which they will allow a write to occur.
|
||||
* Often devices restrict the conditions where writes can be made writes,
|
||||
* so it may not be feasable to append archives stored on all types of
|
||||
* devices.
|
||||
* devices.
|
||||
* Return:
|
||||
* 0 for success, -1 for failure
|
||||
*/
|
||||
@@ -313,7 +313,7 @@ appnd_start(skcnt)
|
||||
warn(1, "Unable to rewrite archive trailer, cannot append.");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* rd_sync()
|
||||
* A read error occurred on this archive volume. Resync the buffer and
|
||||
@@ -488,7 +488,7 @@ rd_skip(skcnt)
|
||||
return(0);
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* wr_fin()
|
||||
* flush out any data (and pad if required) the last block. We always pad
|
||||
* with zero (even though we do not have to). Padding with 0 makes it a
|
||||
@@ -517,7 +517,7 @@ wr_fin()
|
||||
* by format specific write routines to pass a file header). On failure we
|
||||
* punt. We do not allow the user to continue to write flawed archives.
|
||||
* We assume these headers are not very large (the memory copy we use is
|
||||
* a bit expensive).
|
||||
* a bit expensive).
|
||||
* Return:
|
||||
* 0 if buffer was filled ok, -1 o.w. (buffer flush failure)
|
||||
*/
|
||||
@@ -810,7 +810,7 @@ rd_wrfile(arcn, ofd, left)
|
||||
/*
|
||||
* if we failed from archive read, we do not want to skip
|
||||
*/
|
||||
if ((size > 0L) && (*left == 0L))
|
||||
if ((size > 0L) && (*left == 0L))
|
||||
return(-1);
|
||||
|
||||
/*
|
||||
@@ -1019,7 +1019,7 @@ buf_flush(bufcnt)
|
||||
/*
|
||||
* write a block and check if it all went out ok
|
||||
*/
|
||||
cnt = ar_write(buf, blksz);
|
||||
cnt = ar_write(buf, blksz);
|
||||
if (cnt == blksz) {
|
||||
/*
|
||||
* the write went ok
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: cache.c,v 1.2 1994/09/24 02:56:14 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
|
||||
+3
-3
@@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: cpio.c,v 1.3 1995/05/30 00:06:54 rgrimes Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -93,7 +93,7 @@ cpio_strd()
|
||||
* mode; looking for a valid header), and cnt (which starts at zero)
|
||||
* which is used to count the number of empty blocks we have seen so far.
|
||||
* Return:
|
||||
* 0 if a valid trailer, -1 if not a valid trailer,
|
||||
* 0 if a valid trailer, -1 if not a valid trailer,
|
||||
*/
|
||||
|
||||
#if __STDC__
|
||||
@@ -572,7 +572,7 @@ cpio_wr(arcn)
|
||||
/*
|
||||
* vcpio_id()
|
||||
* determine if a block given to us is a valid system VR4 cpio header
|
||||
* WITHOUT crc. WATCH it the magic cookies are in OCTAL, the header
|
||||
* WITHOUT crc. WATCH it the magic cookies are in OCTAL, the header
|
||||
* uses HEX
|
||||
* Return:
|
||||
* 0 if a valid header, -1 otherwise
|
||||
|
||||
+5
-5
@@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)cpio.h 8.1 (Berkeley) 5/31/93
|
||||
* $Id: cpio.h,v 1.2 1994/09/24 02:56:17 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -71,7 +71,7 @@ typedef struct {
|
||||
char c_mtime[11]; /* modification time */
|
||||
char c_namesize[6]; /* length of pathname */
|
||||
char c_filesize[11]; /* length of file in bytes */
|
||||
} HD_CPIO;
|
||||
} HD_CPIO;
|
||||
|
||||
#define MAGIC 070707 /* transportable archive id */
|
||||
|
||||
@@ -82,7 +82,7 @@ typedef struct {
|
||||
#endif /* _PAX_ */
|
||||
|
||||
/*
|
||||
* Binary cpio header structure
|
||||
* Binary cpio header structure
|
||||
*
|
||||
* CAUTION! CAUTION! CAUTION!
|
||||
* Each field really represents a 16 bit short (NOT ASCII). Described as
|
||||
@@ -102,7 +102,7 @@ typedef struct {
|
||||
u_char h_namesize[2];
|
||||
u_char h_filesize_1[2];
|
||||
u_char h_filesize_2[2];
|
||||
} HD_BCPIO;
|
||||
} HD_BCPIO;
|
||||
|
||||
#ifdef _PAX_
|
||||
/*
|
||||
@@ -140,7 +140,7 @@ typedef struct {
|
||||
char c_rmin[8]; /* special file minor # */
|
||||
char c_namesize[8]; /* length of pathname */
|
||||
char c_chksum[8]; /* 0 OR CRC of bytes of FILE data */
|
||||
} HD_VCPIO;
|
||||
} HD_VCPIO;
|
||||
|
||||
#define VMAGIC 070701 /* sVr4 new portable archive id */
|
||||
#define VCMAGIC 070702 /* sVr4 new portable archive id CRC */
|
||||
|
||||
+6
-6
@@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: file_subs.c,v 1.3 1995/05/30 00:06:56 rgrimes Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -159,7 +159,7 @@ file_close(arcn, fd)
|
||||
/*
|
||||
* set owner/groups first as this may strip off mode bits we want
|
||||
* then set file permission modes. Then set file access and
|
||||
* modification times.
|
||||
* modification times.
|
||||
*/
|
||||
if (pids)
|
||||
res = set_ids(arcn->name, arcn->sb.st_uid, arcn->sb.st_gid);
|
||||
@@ -180,7 +180,7 @@ file_close(arcn, fd)
|
||||
/*
|
||||
* lnk_creat()
|
||||
* Create a hard link to arcn->ln_name from arcn->name. arcn->ln_name
|
||||
* must exist;
|
||||
* must exist;
|
||||
* Return:
|
||||
* 0 if ok, -1 otherwise
|
||||
*/
|
||||
@@ -266,7 +266,7 @@ chk_same(arcn)
|
||||
{
|
||||
struct stat sb;
|
||||
|
||||
/*
|
||||
/*
|
||||
* if file does not exist, return. if file exists and -k, skip it
|
||||
* quietly
|
||||
*/
|
||||
@@ -570,7 +570,7 @@ unlnk_exist(name, type)
|
||||
*/
|
||||
if (rmdir(name) < 0) {
|
||||
if (type == PAX_DIR)
|
||||
return(1);
|
||||
return(1);
|
||||
syswarn(1,errno,"Unable to remove directory %s", name);
|
||||
return(-1);
|
||||
}
|
||||
@@ -847,7 +847,7 @@ file_write(fd, str, cnt, rem, isempt, sz, name)
|
||||
register char *end;
|
||||
register int wcnt;
|
||||
register char *st = str;
|
||||
|
||||
|
||||
/*
|
||||
* while we have data to process
|
||||
*/
|
||||
|
||||
+4
-4
@@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ftree.c,v 1.3 1995/05/30 00:06:57 rgrimes Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -214,7 +214,7 @@ ftree_sel(arcn)
|
||||
* when file trees are supplied pax as args. The list is not used when
|
||||
* the trees are read from stdin.
|
||||
*/
|
||||
if (ftcur != NULL)
|
||||
if (ftcur != NULL)
|
||||
ftcur->refcnt = 1;
|
||||
|
||||
/*
|
||||
@@ -307,7 +307,7 @@ ftree_arg()
|
||||
if (fthead == NULL) {
|
||||
/*
|
||||
* the user didn't supply any args, get the file trees
|
||||
* to process from stdin;
|
||||
* to process from stdin;
|
||||
*/
|
||||
if (fgets(farray[0], PAXPATHLEN+1, stdin) == NULL)
|
||||
return(-1);
|
||||
@@ -362,7 +362,7 @@ next_file(arcn)
|
||||
/*
|
||||
* ftree_sel() might have set the ftree_skip flag if the user has the
|
||||
* -n option and a file was selected from this file arg tree. (-n says
|
||||
* only one member is matched for each pattern) ftree_skip being 1
|
||||
* only one member is matched for each pattern) ftree_skip being 1
|
||||
* forces us to go to the next arg now.
|
||||
*/
|
||||
if (ftree_skip) {
|
||||
|
||||
+9
-8
@@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: gen_subs.c,v 1.4.4.1 1995/08/28 10:41:14 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -47,6 +47,7 @@ static char sccsid[] = "@(#)gen_subs.c 8.1 (Berkeley) 5/31/93";
|
||||
#include <sys/param.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <tzfile.h>
|
||||
#include <utmp.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
@@ -63,7 +64,7 @@ static char sccsid[] = "@(#)gen_subs.c 8.1 (Berkeley) 5/31/93";
|
||||
*/
|
||||
#define MODELEN 20
|
||||
#define DATELEN 64
|
||||
#define SIXMONTHS ((365 / 2) * 86400)
|
||||
#define SIXMONTHS ((DAYSPERNYEAR / 2) * SECSPERDAY)
|
||||
#define CURFRMT "%b %e %H:%M"
|
||||
#define OLDFRMT "%b %e %Y"
|
||||
#ifndef UT_NAMESIZE
|
||||
@@ -134,7 +135,7 @@ ls_list(arcn, now)
|
||||
# ifdef NET2_STAT
|
||||
(void)printf("%4u,%4u ", MAJOR(sbp->st_rdev),
|
||||
# else
|
||||
(void)printf("%4lu,%4lu ", (unsigned long)MAJOR(sbp->st_rdev),
|
||||
(void)printf("%4lu,%4lu ", MAJOR(sbp->st_rdev),
|
||||
# endif
|
||||
MINOR(sbp->st_rdev));
|
||||
else {
|
||||
@@ -202,7 +203,7 @@ ls_tty(arcn)
|
||||
/*
|
||||
* zf_strncpy()
|
||||
* copy src to dest up to len chars (stopping at first '\0'), when src is
|
||||
* shorter than len, pads to len with '\0'. big performance win (and
|
||||
* shorter than len, pads to len with '\0'. big performance win (and
|
||||
* a lot easier to code) over strncpy(), then a strlen() then a
|
||||
* bzero(). (or doing the bzero() first).
|
||||
*/
|
||||
@@ -334,7 +335,7 @@ ul_asc(val, str, len, base)
|
||||
{
|
||||
register char *pt;
|
||||
u_long digit;
|
||||
|
||||
|
||||
/*
|
||||
* WARNING str is not '\0' terminated by this routine
|
||||
*/
|
||||
@@ -349,7 +350,7 @@ ul_asc(val, str, len, base)
|
||||
while (pt >= str) {
|
||||
if ((digit = (val & 0xf)) < 10)
|
||||
*pt-- = '0' + (char)digit;
|
||||
else
|
||||
else
|
||||
*pt-- = 'a' + (char)(digit - 10);
|
||||
if ((val = (val >> 4)) == (u_long)0)
|
||||
break;
|
||||
@@ -448,7 +449,7 @@ uqd_asc(val, str, len, base)
|
||||
{
|
||||
register char *pt;
|
||||
u_quad_t digit;
|
||||
|
||||
|
||||
/*
|
||||
* WARNING str is not '\0' terminated by this routine
|
||||
*/
|
||||
@@ -463,7 +464,7 @@ uqd_asc(val, str, len, base)
|
||||
while (pt >= str) {
|
||||
if ((digit = (val & 0xf)) < 10)
|
||||
*pt-- = '0' + (char)digit;
|
||||
else
|
||||
else
|
||||
*pt-- = 'a' + (char)(digit - 10);
|
||||
if ((val = (val >> 4)) == (u_quad_t)0)
|
||||
break;
|
||||
|
||||
+16
-16
@@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: options.c,v 1.3 1995/03/19 13:28:53 joerg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -90,34 +90,34 @@ static void cpio_usage __P((void));
|
||||
|
||||
FSUB fsub[] = {
|
||||
/* 0: OLD BINARY CPIO */
|
||||
{"bcpio", 5120, sizeof(HD_BCPIO), 1, 0, 0, 1, bcpio_id, cpio_strd,
|
||||
"bcpio", 5120, sizeof(HD_BCPIO), 1, 0, 0, 1, bcpio_id, cpio_strd,
|
||||
bcpio_rd, bcpio_endrd, cpio_stwr, bcpio_wr, cpio_endwr, cpio_trail,
|
||||
rd_wrfile, wr_rdfile, bad_opt},
|
||||
rd_wrfile, wr_rdfile, bad_opt,
|
||||
|
||||
/* 1: OLD OCTAL CHARACTER CPIO */
|
||||
{"cpio", 5120, sizeof(HD_CPIO), 1, 0, 0, 1, cpio_id, cpio_strd,
|
||||
"cpio", 5120, sizeof(HD_CPIO), 1, 0, 0, 1, cpio_id, cpio_strd,
|
||||
cpio_rd, cpio_endrd, cpio_stwr, cpio_wr, cpio_endwr, cpio_trail,
|
||||
rd_wrfile, wr_rdfile, bad_opt},
|
||||
rd_wrfile, wr_rdfile, bad_opt,
|
||||
|
||||
/* 2: SVR4 HEX CPIO */
|
||||
{"sv4cpio", 5120, sizeof(HD_VCPIO), 1, 0, 0, 1, vcpio_id, cpio_strd,
|
||||
"sv4cpio", 5120, sizeof(HD_VCPIO), 1, 0, 0, 1, vcpio_id, cpio_strd,
|
||||
vcpio_rd, vcpio_endrd, cpio_stwr, vcpio_wr, cpio_endwr, cpio_trail,
|
||||
rd_wrfile, wr_rdfile, bad_opt},
|
||||
rd_wrfile, wr_rdfile, bad_opt,
|
||||
|
||||
/* 3: SVR4 HEX CPIO WITH CRC */
|
||||
{"sv4crc", 5120, sizeof(HD_VCPIO), 1, 0, 0, 1, crc_id, crc_strd,
|
||||
"sv4crc", 5120, sizeof(HD_VCPIO), 1, 0, 0, 1, crc_id, crc_strd,
|
||||
vcpio_rd, vcpio_endrd, crc_stwr, vcpio_wr, cpio_endwr, cpio_trail,
|
||||
rd_wrfile, wr_rdfile, bad_opt},
|
||||
rd_wrfile, wr_rdfile, bad_opt,
|
||||
|
||||
/* 4: OLD TAR */
|
||||
{"tar", 10240, BLKMULT, 0, 1, BLKMULT, 0, tar_id, no_op,
|
||||
"tar", 10240, BLKMULT, 0, 1, BLKMULT, 0, tar_id, no_op,
|
||||
tar_rd, tar_endrd, no_op, tar_wr, tar_endwr, tar_trail,
|
||||
rd_wrfile, wr_rdfile, tar_opt},
|
||||
rd_wrfile, wr_rdfile, tar_opt,
|
||||
|
||||
/* 5: POSIX USTAR */
|
||||
{"ustar", 10240, BLKMULT, 0, 1, BLKMULT, 0, ustar_id, ustar_strd,
|
||||
"ustar", 10240, BLKMULT, 0, 1, BLKMULT, 0, ustar_id, ustar_strd,
|
||||
ustar_rd, tar_endrd, ustar_stwr, ustar_wr, tar_endwr, tar_trail,
|
||||
rd_wrfile, wr_rdfile, bad_opt},
|
||||
rd_wrfile, wr_rdfile, bad_opt,
|
||||
};
|
||||
#define F_TAR 4 /* format when called as tar */
|
||||
#define DEFLT 5 /* default write format from list above */
|
||||
@@ -367,8 +367,8 @@ pax_options(argc, argv)
|
||||
* specify an archive format on write
|
||||
*/
|
||||
tmp.name = optarg;
|
||||
if ((frmt = (FSUB *)bsearch((void *)&tmp, (void *)fsub,
|
||||
sizeof(fsub)/sizeof(FSUB), sizeof(FSUB), c_frmt))) {
|
||||
if (frmt = (FSUB *)bsearch((void *)&tmp, (void *)fsub,
|
||||
sizeof(fsub)/sizeof(FSUB), sizeof(FSUB), c_frmt)) {
|
||||
flg |= XF;
|
||||
break;
|
||||
}
|
||||
@@ -823,7 +823,7 @@ printflg(flg)
|
||||
int pos = 0;
|
||||
|
||||
(void)fprintf(stderr,"%s: Invalid combination of options:", argv0);
|
||||
while ((nxt = ffs(flg))) {
|
||||
while (nxt = ffs(flg)) {
|
||||
flg = flg >> nxt;
|
||||
pos += nxt;
|
||||
(void)fprintf(stderr, " -%c", flgch[pos-1]);
|
||||
|
||||
+15
-15
@@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: pat_rep.c,v 1.4 1995/05/30 00:06:59 rgrimes Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -88,7 +88,7 @@ static int resub __P((regex_t *, regmatch_t *, char *, char *, char *));
|
||||
* parses the -s replacement string; compiles the regular expression
|
||||
* and stores the compiled value and it's replacement string together in
|
||||
* replacement string list. Input to this function is of the form:
|
||||
* /old/new/pg
|
||||
* /old/new/pg
|
||||
* The first char in the string specifies the delimiter used by this
|
||||
* replacement string. "Old" is a regular expression in "ed" format which
|
||||
* is compiled by regcomp() and is applied to filenames. "new" is the
|
||||
@@ -348,7 +348,7 @@ pat_sel(arcn)
|
||||
|
||||
/*
|
||||
* we reach this point only when we allow a single selected match per
|
||||
* pattern, if the pattern matches a directory and we do not have -d
|
||||
* pattern, if the pattern matches a directory and we do not have -d
|
||||
* (dflag) we are done with this pattern. We may also be handed a file
|
||||
* in the subtree of a directory. in that case when we are operating
|
||||
* with -d, this pattern was already selected and we are done
|
||||
@@ -372,7 +372,7 @@ pat_sel(arcn)
|
||||
*/
|
||||
if (pt->pend != NULL)
|
||||
*pt->pend = '\0';
|
||||
|
||||
|
||||
if ((pt->pstr = strdup(arcn->name)) == NULL) {
|
||||
warn(1, "Pattern select out of memory");
|
||||
if (pt->pend != NULL)
|
||||
@@ -397,7 +397,7 @@ pat_sel(arcn)
|
||||
if (*(pt->pstr + len) == '/') {
|
||||
*(pt->pstr + len) = '\0';
|
||||
pt->plen = len;
|
||||
}
|
||||
}
|
||||
pt->flgs = DIR_MTCH | MTCH;
|
||||
arcn->pat = pt;
|
||||
return(0);
|
||||
@@ -438,7 +438,7 @@ pat_sel(arcn)
|
||||
* this archive member is "selected" we process and mark the pattern as
|
||||
* one which matched a selected archive member (see pat_sel())
|
||||
* Return:
|
||||
* 0 if this archive member should be processed, 1 if it should be
|
||||
* 0 if this archive member should be processed, 1 if it should be
|
||||
* skipped and -1 if we are done with all patterns (and pax should quit
|
||||
* looking for more members)
|
||||
*/
|
||||
@@ -515,7 +515,7 @@ pat_match(arcn)
|
||||
/*
|
||||
* fn_match()
|
||||
* Return:
|
||||
* 0 if this archive member should be processed, 1 if it should be
|
||||
* 0 if this archive member should be processed, 1 if it should be
|
||||
* skipped and -1 if we are done with all patterns (and pax should quit
|
||||
* looking for more members)
|
||||
* Note: *pend may be changed to show where the prefix ends.
|
||||
@@ -564,7 +564,7 @@ fn_match(pattern, string, pend)
|
||||
case '*':
|
||||
c = *pattern;
|
||||
/*
|
||||
* Collapse multiple *'s.
|
||||
* Collapse multiple *'s.
|
||||
*/
|
||||
while (c == '*')
|
||||
c = *++pattern;
|
||||
@@ -617,7 +617,7 @@ range_match(pattern, test)
|
||||
int negate;
|
||||
int ok = 0;
|
||||
|
||||
if ((negate = (*pattern == '!')))
|
||||
if (negate = (*pattern == '!'))
|
||||
++pattern;
|
||||
|
||||
while ((c = *pattern++) != ']') {
|
||||
@@ -649,7 +649,7 @@ range_match(pattern, test)
|
||||
* if we spot any file links to the old file name in the future, we will
|
||||
* know exactly how to fix the file link.
|
||||
* Return:
|
||||
* 0 continue to process file, 1 skip this file, -1 pax is finished
|
||||
* 0 continue to process file, 1 skip this file, -1 pax is finished
|
||||
*/
|
||||
|
||||
#if __STDC__
|
||||
@@ -862,7 +862,7 @@ fix_path(or_name, or_len, dir_name, dir_len)
|
||||
*or_len = len;
|
||||
|
||||
/*
|
||||
* enough space, shift
|
||||
* enough space, shift
|
||||
*/
|
||||
while (src >= start)
|
||||
*dest-- = *src--;
|
||||
@@ -1014,7 +1014,7 @@ rep_name(name, nlen, prnt)
|
||||
*/
|
||||
} while (pt->flgs & GLOB);
|
||||
|
||||
if (found)
|
||||
if (found)
|
||||
break;
|
||||
|
||||
/*
|
||||
@@ -1037,7 +1037,7 @@ rep_name(name, nlen, prnt)
|
||||
warn(1,"Replacement name too long %s >> %s",
|
||||
name, nname);
|
||||
return(1);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* inform the user of the result if wanted
|
||||
@@ -1046,7 +1046,7 @@ rep_name(name, nlen, prnt)
|
||||
if (*nname == '\0')
|
||||
(void)fprintf(stderr,"%s >> <empty string>\n",
|
||||
name);
|
||||
else
|
||||
else
|
||||
(void)fprintf(stderr,"%s >> %s\n", name, nname);
|
||||
}
|
||||
|
||||
@@ -1054,7 +1054,7 @@ rep_name(name, nlen, prnt)
|
||||
* if empty inform the caller this file is to be skipped
|
||||
* otherwise copy the new name over the orig name and return
|
||||
*/
|
||||
if (*nname == '\0')
|
||||
if (*nname == '\0')
|
||||
return(1);
|
||||
*nlen = l_strncpy(name, nname, PAXPATHLEN + 1);
|
||||
}
|
||||
|
||||
+2
-2
@@ -34,7 +34,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)pax.1 8.4 (Berkeley) 4/18/94
|
||||
.\" $Id: pax.1,v 1.3 1995/08/16 23:12:25 nate Exp $
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd April 18, 1994
|
||||
.Dt PAX 1
|
||||
@@ -1048,7 +1048,7 @@ copies the contents of the current directory to the device
|
||||
.Pa /dev/rst0 .
|
||||
.Pp
|
||||
The command:
|
||||
.Dl pax -v -f filename
|
||||
.Dl pax -r -v -f filename
|
||||
gives the verbose table of contents for an archive stored in
|
||||
.Pa filename .
|
||||
.Pp
|
||||
|
||||
+12
-12
@@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: pax.c,v 1.3 1995/05/30 00:07:00 rgrimes Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -116,7 +116,7 @@ sigset_t s_mask; /* signal mask for cleanup critical sect */
|
||||
*
|
||||
* 1 READ ENHANCEMENTS
|
||||
* 1.1 Operations which read archives will continue to operate even when
|
||||
* processing archives which may be damaged, truncated, or fail to meet
|
||||
* processing archives which may be damaged, truncated, or fail to meet
|
||||
* format specs in several different ways. Damaged sections of archives
|
||||
* are detected and avoided if possible. Attempts will be made to resync
|
||||
* archive read operations even with badly damaged media.
|
||||
@@ -131,7 +131,7 @@ sigset_t s_mask; /* signal mask for cleanup critical sect */
|
||||
* 1.5 The user is notified whenever something is found during archive
|
||||
* read operations which violates spec (but the read will continue).
|
||||
* 1.6 Multiple archive volumes can be read and may span over different
|
||||
* archive devices
|
||||
* archive devices
|
||||
* 1.7 Rigidly restores all file attributes exactly as they are stored on the
|
||||
* archive.
|
||||
* 1.8 Modification change time ranges can be specified via multiple -T
|
||||
@@ -157,7 +157,7 @@ sigset_t s_mask; /* signal mask for cleanup critical sect */
|
||||
* these fields. This removes any restrictions on using these archive
|
||||
* formats on large file systems.
|
||||
* 2.5 Multiple archive volumes can be written and may span over different
|
||||
* archive devices
|
||||
* archive devices
|
||||
* 2.6 A archive volume record limit allows the user to specify the number
|
||||
* of bytes stored on an archive volume. When reached the user is
|
||||
* prompted for the next archive volume. This is specified with the
|
||||
@@ -204,7 +204,7 @@ sigset_t s_mask; /* signal mask for cleanup critical sect */
|
||||
* name modification (-Z)
|
||||
*
|
||||
* 4 GENERAL ENHANCEMENTS
|
||||
* 4.1 Internal structure is designed to isolate format dependent and
|
||||
* 4.1 Internal structure is designed to isolate format dependent and
|
||||
* independent functions. Formats are selected via a format driver table.
|
||||
* This encourages the addition of new archive formats by only having to
|
||||
* write those routines which id, read and write the archive header.
|
||||
@@ -235,7 +235,7 @@ main(argc, argv)
|
||||
return(exit_val);
|
||||
|
||||
/*
|
||||
* select a primary operation mode
|
||||
* select a primary operation mode
|
||||
*/
|
||||
switch(act) {
|
||||
case EXTRACT:
|
||||
@@ -349,7 +349,7 @@ gen_init()
|
||||
/*
|
||||
* Handle posix locale
|
||||
*
|
||||
* set user defines time printing format for -v option
|
||||
* set user defines time printing format for -v option
|
||||
*/
|
||||
ltmfrmt = getenv("LC_TIME");
|
||||
|
||||
@@ -371,27 +371,27 @@ gen_init()
|
||||
n_hand.sa_handler = sig_cleanup;
|
||||
|
||||
if ((sigaction(SIGHUP, &n_hand, &o_hand) < 0) &&
|
||||
(o_hand.sa_handler == SIG_IGN) &&
|
||||
(o_hand.sa_handler == SIG_IGN) &&
|
||||
(sigaction(SIGHUP, &o_hand, &o_hand) < 0))
|
||||
goto out;
|
||||
|
||||
if ((sigaction(SIGTERM, &n_hand, &o_hand) < 0) &&
|
||||
(o_hand.sa_handler == SIG_IGN) &&
|
||||
(o_hand.sa_handler == SIG_IGN) &&
|
||||
(sigaction(SIGTERM, &o_hand, &o_hand) < 0))
|
||||
goto out;
|
||||
|
||||
if ((sigaction(SIGINT, &n_hand, &o_hand) < 0) &&
|
||||
(o_hand.sa_handler == SIG_IGN) &&
|
||||
(o_hand.sa_handler == SIG_IGN) &&
|
||||
(sigaction(SIGINT, &o_hand, &o_hand) < 0))
|
||||
goto out;
|
||||
|
||||
if ((sigaction(SIGQUIT, &n_hand, &o_hand) < 0) &&
|
||||
(o_hand.sa_handler == SIG_IGN) &&
|
||||
(o_hand.sa_handler == SIG_IGN) &&
|
||||
(sigaction(SIGQUIT, &o_hand, &o_hand) < 0))
|
||||
goto out;
|
||||
|
||||
if ((sigaction(SIGXCPU, &n_hand, &o_hand) < 0) &&
|
||||
(o_hand.sa_handler == SIG_IGN) &&
|
||||
(o_hand.sa_handler == SIG_IGN) &&
|
||||
(sigaction(SIGXCPU, &o_hand, &o_hand) < 0))
|
||||
goto out;
|
||||
|
||||
|
||||
+7
-7
@@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)pax.h 8.2 (Berkeley) 4/18/94
|
||||
* $Id: pax.h,v 1.3 1995/05/30 00:07:01 rgrimes Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -63,7 +63,7 @@
|
||||
#define DEFOP LIST /* if no flags default is to LIST */
|
||||
|
||||
/*
|
||||
* Device type of the current archive volume
|
||||
* Device type of the current archive volume
|
||||
*/
|
||||
#define ISREG 0 /* regular file */
|
||||
#define ISCHR 1 /* character device */
|
||||
@@ -76,7 +76,7 @@
|
||||
*
|
||||
* The format specific routine table allows new archive formats to be quickly
|
||||
* added. Overall pax operation is independent of the actual format used to
|
||||
* form the archive. Only those routines which deal directly with the archive
|
||||
* form the archive. Only those routines which deal directly with the archive
|
||||
* are tailored to the oddities of the specifc format. All other routines are
|
||||
* independent of the archive format. Data flow in and out of the format
|
||||
* dependent routines pass pointers to ARCHD structure (described below).
|
||||
@@ -207,7 +207,7 @@ typedef struct {
|
||||
#define PAX_FIF 7 /* fifo */
|
||||
#define PAX_HLK 8 /* hard link */
|
||||
#define PAX_HRG 9 /* hard link to a regular file */
|
||||
#define PAX_CTG 10 /* high performance file */
|
||||
#define PAX_CTG 10 /* high performance file */
|
||||
} ARCHD;
|
||||
|
||||
/*
|
||||
@@ -227,9 +227,9 @@ typedef struct oplist {
|
||||
#ifndef MIN
|
||||
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||
#endif
|
||||
#define MAJOR(x) major(x)
|
||||
#define MINOR(x) minor(x)
|
||||
#define TODEV(x, y) makedev((x), (y))
|
||||
#define MAJOR(x) (((unsigned)(x) >> 8) & 0xff)
|
||||
#define MINOR(x) ((x) & 0xff)
|
||||
#define TODEV(x, y) (((unsigned)(x) << 8) | ((unsigned)(y)))
|
||||
|
||||
/*
|
||||
* General Defines
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: sel_subs.c,v 1.2 1994/09/24 02:56:29 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
|
||||
+14
-14
@@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: tables.c,v 1.3 1995/05/30 00:07:01 rgrimes Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -85,7 +85,7 @@ static DEVT *chk_dev __P((dev_t, int));
|
||||
/*
|
||||
* hard link table routines
|
||||
*
|
||||
* The hard link table tries to detect hard links to files using the device and
|
||||
* The hard link table tries to detect hard links to files using the device and
|
||||
* inode values. We do this when writing an archive, so we can tell the format
|
||||
* write routine that this file is a hard link to another file. The format
|
||||
* write routine then can store this file in whatever way it wants (as a hard
|
||||
@@ -333,10 +333,10 @@ lnk_end()
|
||||
* that this is one HUGE database. To save memory space, the actual file names
|
||||
* are stored in a scatch file and indexed by an in memory hash table. The
|
||||
* hash table is indexed by hashing the file path. The nodes in the table store
|
||||
* the length of the filename and the lseek offset within the scratch file
|
||||
* the length of the filename and the lseek offset within the scratch file
|
||||
* where the actual name is stored. Since there are never any deletions to this
|
||||
* table, fragmentation of the scratch file is never a issue. Lookups seem to
|
||||
* not exhibit any locality at all (files in the database are rarely
|
||||
* not exhibit any locality at all (files in the database are rarely
|
||||
* looked up more than once...). So caching is just a waste of memory. The
|
||||
* only limitation is the amount of scatch file space available to store the
|
||||
* path names.
|
||||
@@ -468,7 +468,7 @@ chk_ftime(arcn)
|
||||
*/
|
||||
pt->mtime = arcn->sb.st_mtime;
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* file is older
|
||||
*/
|
||||
@@ -493,7 +493,7 @@ chk_ftime(arcn)
|
||||
return(0);
|
||||
}
|
||||
syswarn(1, errno, "Failed write to file time table");
|
||||
} else
|
||||
} else
|
||||
syswarn(1, errno, "Failed seek on file time table");
|
||||
} else
|
||||
warn(1, "File time table ran out of memory");
|
||||
@@ -567,7 +567,7 @@ add_name(oname, onamelen, nname)
|
||||
* should never happen
|
||||
*/
|
||||
warn(0, "No interactive rename table, links may fail\n");
|
||||
return(0);
|
||||
return(0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -666,7 +666,7 @@ sub_name(oname, onamelen)
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* device/inode mapping table routines
|
||||
* (used with formats that store device and inodes fields)
|
||||
@@ -856,7 +856,7 @@ map_dev(arcn, dev_mask, ino_mask)
|
||||
return(0);
|
||||
/*
|
||||
* check for device and inode truncation, and extract the truncated
|
||||
* bit pattern.
|
||||
* bit pattern.
|
||||
*/
|
||||
if ((arcn->sb.st_dev & (dev_t)dev_mask) != arcn->sb.st_dev)
|
||||
++trc_dev;
|
||||
@@ -1064,7 +1064,7 @@ add_atdir(fname, dev, ino, mtime, atime)
|
||||
return;
|
||||
|
||||
/*
|
||||
* make sure this directory is not already in the table, if so just
|
||||
* make sure this directory is not already in the table, if so just
|
||||
* return (the older entry always has the correct time). The only
|
||||
* way this will happen is when the same subtree can be traversed by
|
||||
* different args to pax and the -n option is aborting fts out of a
|
||||
@@ -1233,7 +1233,7 @@ dir_start()
|
||||
* name is name of the directory, psb the stat buffer with the data in it,
|
||||
* frc_mode is a flag that says whether to force the setting of the mode
|
||||
* (ignoring the user set values for preserving file mode). Frc_mode is
|
||||
* for the case where we created a file and found that the resulting
|
||||
* for the case where we created a file and found that the resulting
|
||||
* directory was not writeable and the user asked for file modes to NOT
|
||||
* be preserved. (we have to preserve what was created by default, so we
|
||||
* have to force the setting at the end. this is stated explicitly in the
|
||||
@@ -1312,15 +1312,15 @@ proc_dir()
|
||||
* read the trailer, then the file name, if this fails
|
||||
* just give up.
|
||||
*/
|
||||
if (lseek(dirfd, -((off_t)sizeof(dblk)), SEEK_CUR) < 0)
|
||||
if (lseek(dirfd, -((off_t)sizeof(dblk)), SEEK_CUR) < 0)
|
||||
break;
|
||||
if (read(dirfd,(char *)&dblk, sizeof(dblk)) != sizeof(dblk))
|
||||
break;
|
||||
if (lseek(dirfd, dblk.npos, SEEK_SET) < 0)
|
||||
if (lseek(dirfd, dblk.npos, SEEK_SET) < 0)
|
||||
break;
|
||||
if (read(dirfd, name, dblk.nlen) != dblk.nlen)
|
||||
break;
|
||||
if (lseek(dirfd, dblk.npos, SEEK_SET) < 0)
|
||||
if (lseek(dirfd, dblk.npos, SEEK_SET) < 0)
|
||||
break;
|
||||
|
||||
/*
|
||||
|
||||
+2
-2
@@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)tables.h 8.1 (Berkeley) 5/31/93
|
||||
* $Id: tables.h,v 1.2 1994/09/24 02:56:35 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -106,7 +106,7 @@ typedef struct namt {
|
||||
* this table. (When the inode field in the archive header are too small, we
|
||||
* remap the dev on writes to remove accidental collisions).
|
||||
*
|
||||
* The list is hashed by device number using chain collision resolution. Off of
|
||||
* The list is hashed by device number using chain collision resolution. Off of
|
||||
* each DEVT are linked the various remaps for this device based on those bits
|
||||
* in the inode which were truncated. For example if we are just remapping to
|
||||
* avoid a device number during an update append, off the DEVT we would have
|
||||
|
||||
+8
-8
@@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: tar.c,v 1.3 1995/05/30 00:07:03 rgrimes Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -182,7 +182,7 @@ ul_oct(val, str, len, term)
|
||||
#endif
|
||||
{
|
||||
register char *pt;
|
||||
|
||||
|
||||
/*
|
||||
* term selects the appropriate character(s) for the end of the string
|
||||
*/
|
||||
@@ -246,7 +246,7 @@ uqd_oct(val, str, len, term)
|
||||
#endif
|
||||
{
|
||||
register char *pt;
|
||||
|
||||
|
||||
/*
|
||||
* term selects the appropriate character(s) for the end of the string
|
||||
*/
|
||||
@@ -315,8 +315,8 @@ tar_chksm(blk, len)
|
||||
*/
|
||||
pt = blk;
|
||||
stop = blk + CHK_OFFSET;
|
||||
while (pt < stop)
|
||||
chksm += (u_long)(*pt++ & 0xff);
|
||||
while (pt < stop)
|
||||
chksm += (u_long)(*pt++ & 0xff);
|
||||
/*
|
||||
* move past the checksum field and keep going, spec counts the
|
||||
* checksum field as the sum of 8 blanks (which is pre-computed as
|
||||
@@ -327,7 +327,7 @@ tar_chksm(blk, len)
|
||||
pt += CHK_LEN;
|
||||
stop = blk + len;
|
||||
while (pt < stop)
|
||||
chksm += (u_long)(*pt++ & 0xff);
|
||||
chksm += (u_long)(*pt++ & 0xff);
|
||||
return(chksm);
|
||||
}
|
||||
|
||||
@@ -532,7 +532,7 @@ tar_rd(arcn, buf)
|
||||
* strip off any trailing slash.
|
||||
*/
|
||||
if (*pt == '/') {
|
||||
*pt = '\0';
|
||||
*pt = '\0';
|
||||
--arcn->nlen;
|
||||
}
|
||||
return(0);
|
||||
@@ -1013,7 +1013,7 @@ ustar_wr(arcn)
|
||||
*/
|
||||
zf_strncpy(hd->name, pt, sizeof(hd->name));
|
||||
|
||||
/*
|
||||
/*
|
||||
* set the fields in the header that are type dependent
|
||||
*/
|
||||
switch(arcn->type) {
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: tty_subs.c,v 1.2 1994/09/24 02:56:38 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
|
||||
+3
-3
@@ -1,12 +1,12 @@
|
||||
# @(#)Makefile 8.1 (Berkeley) 6/2/93
|
||||
# $Id: Makefile,v 1.5 1995/04/15 03:31:19 davidg Exp $
|
||||
# $Id$
|
||||
|
||||
PROG= ps
|
||||
SRCS= fmt.c keyword.c nlist.c print.c ps.c
|
||||
CFLAGS+=-I/sys
|
||||
DPADD= ${LIBMATH} ${LIBKVM}
|
||||
LDADD= -lm -lkvm
|
||||
BINGRP= kmem
|
||||
BINMODE=2555
|
||||
BINOWN= root
|
||||
BINMODE=4555
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
+3
-6
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: fmt.c,v 1.5 1995/03/09 20:40:17 davidg Exp $
|
||||
* $Id: fmt.c,v 1.3 1994/09/24 02:56:43 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -75,9 +75,6 @@ shquote(argv)
|
||||
dst++;
|
||||
*dst++ = ' ';
|
||||
}
|
||||
/* Chop off trailing space */
|
||||
if (dst != buf)
|
||||
dst--;
|
||||
*dst = '\0';
|
||||
return (buf);
|
||||
}
|
||||
@@ -112,9 +109,9 @@ fmt_argv(argv, cmd, maxlen)
|
||||
if ((cp = malloc(len)) == NULL)
|
||||
return (NULL);
|
||||
if (ap == NULL)
|
||||
sprintf(cp, " (%.*s)", maxlen, cmd);
|
||||
sprintf(cp, "(%.*s)", maxlen, cmd);
|
||||
else if (strncmp(cmdpart(argv[0]), cmd, maxlen) != 0)
|
||||
sprintf(cp, "%s (%.*s)", ap, maxlen, cmd);
|
||||
sprintf(cp, "%s(%.*s)", ap, maxlen, cmd);
|
||||
else
|
||||
(void) strcpy(cp, ap);
|
||||
return (cp);
|
||||
|
||||
+3
-3
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: keyword.c,v 1.5.6.1 1995/10/05 07:46:36 davidg Exp $
|
||||
* $Id: keyword.c,v 1.4 1994/10/02 08:19:10 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -161,7 +161,7 @@ VAR var[] = {
|
||||
{"tpgid", "TPGID", NULL, 0, evar, 4, EOFF(e_tpgid), ULONG, PIDFMT},
|
||||
{"tsess", "TSESS", NULL, 0, evar, 6, EOFF(e_tsess), KPTR, "x"},
|
||||
{"tsiz", "TSIZ", NULL, 0, tsize, 4},
|
||||
{"tt", "TT ", NULL, 0, tname, 4},
|
||||
{"tt", "TT", NULL, LJUST, tname, 3},
|
||||
{"tty", "TTY", NULL, LJUST, longtname, 8},
|
||||
{"ucomm", "UCOMM", NULL, LJUST, ucomm, MAXCOMLEN},
|
||||
{"uid", "UID", NULL, 0, evar, UIDLEN, EOFF(e_ucred.cr_uid),
|
||||
@@ -248,7 +248,7 @@ VAR var[] = {
|
||||
{"trs", "TRS", NULL, 0, trss, 3},
|
||||
{"tsess", "TSESS", NULL, 0, evar, 6, EOFF(e_tsess), KPTR, "x"},
|
||||
{"tsiz", "TSIZ", NULL, 0, tsize, 4},
|
||||
{"tt", "TT", NULL, LJUST, tname, 4},
|
||||
{"tt", "TT", NULL, LJUST, tname, 3},
|
||||
{"tty", "TTY", NULL, LJUST, longtname, 8},
|
||||
{"ucomm", "UCOMM", NULL, LJUST, ucomm, MAXCOMLEN},
|
||||
{"uid", "UID", NULL, 0, pvar, UIDLEN, POFF(p_uid),USHORT, UIDFMT},
|
||||
|
||||
+1
-2
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: nlist.c,v 1.4 1994/10/02 08:33:29 davidg Exp $
|
||||
* $Id: nlist.c,v 1.3 1994/10/02 08:19:11 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -111,7 +111,6 @@ donlist()
|
||||
eval = rval = 1;
|
||||
}
|
||||
mempages -= tmp;
|
||||
mempages /= PAGE_SIZE;
|
||||
#else
|
||||
if (kread(X_ECMX, mempages)) {
|
||||
warnx("ecmx: %s", kvm_geterr(kd));
|
||||
|
||||
+10
-9
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: print.c,v 1.7.4.2 1995/10/05 07:46:37 davidg Exp $
|
||||
* $Id: print.c,v 1.4 1994/10/02 08:33:30 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -65,6 +65,7 @@ static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <vis.h>
|
||||
#include <tzfile.h>
|
||||
|
||||
#include "ps.h"
|
||||
|
||||
@@ -322,7 +323,7 @@ tname(k, ve)
|
||||
v = ve->var;
|
||||
dev = KI_EPROC(k)->e_tdev;
|
||||
if (dev == NODEV || (ttname = devname(dev, S_IFCHR)) == NULL)
|
||||
(void)printf("%*s ", v->width-1, "??");
|
||||
(void)printf("%-*s", v->width, "??");
|
||||
else {
|
||||
if (strncmp(ttname, "tty", 3) == 0 ||
|
||||
strncmp(ttname, "cua", 3) == 0)
|
||||
@@ -368,11 +369,11 @@ started(k, ve)
|
||||
tp = localtime(&k->ki_u.u_start.tv_sec);
|
||||
if (!now)
|
||||
(void)time(&now);
|
||||
if (now - k->ki_u.u_start.tv_sec < 24 * 3600) {
|
||||
if (now - k->ki_u.u_start.tv_sec < 24 * SECSPERHOUR) {
|
||||
/* I *hate* SCCS... */
|
||||
static char fmt[] = __CONCAT("%l:%", "M%p");
|
||||
(void)strftime(buf, sizeof(buf) - 1, fmt, tp);
|
||||
} else if (now - k->ki_u.u_start.tv_sec < 7 * 86400) {
|
||||
} else if (now - k->ki_u.u_start.tv_sec < 7 * SECSPERDAY) {
|
||||
/* I *hate* SCCS... */
|
||||
static char fmt[] = __CONCAT("%a%", "I%p");
|
||||
(void)strftime(buf, sizeof(buf) - 1, fmt, tp);
|
||||
@@ -409,7 +410,7 @@ wchan(k, ve)
|
||||
v = ve->var;
|
||||
if (KI_PROC(k)->p_wchan) {
|
||||
if (KI_PROC(k)->p_wmesg)
|
||||
(void)printf("%-*.*s", v->width, v->width,
|
||||
(void)printf("%-*.*s", v->width, v->width,
|
||||
KI_EPROC(k)->e_wmesg);
|
||||
else
|
||||
(void)printf("%-*x", v->width,
|
||||
@@ -467,7 +468,7 @@ p_rssize(k, ve) /* doesn't account for text */
|
||||
#ifndef NEWVM
|
||||
(void)printf("%*d", v->width, pgtok(KI_PROC(k)->p_rssize));
|
||||
#else
|
||||
(void)printf("%*ld", v->width, pgtok(KI_EPROC(k)->e_vm.vm_rssize));
|
||||
(void)printf("%*d", v->width, pgtok(KI_EPROC(k)->e_vm.vm_rssize));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -598,7 +599,7 @@ pagein(k, ve)
|
||||
VAR *v;
|
||||
|
||||
v = ve->var;
|
||||
(void)printf("%*ld", v->width,
|
||||
(void)printf("%*d", v->width,
|
||||
k->ki_u.u_valid ? k->ki_u.u_ru.ru_majflt : 0);
|
||||
}
|
||||
|
||||
@@ -629,7 +630,7 @@ tsize(k, ve)
|
||||
#ifndef NEWVM
|
||||
(void)printf("%*d", v->width, pgtok(KI_EPROC(k)->e_xsize));
|
||||
#else
|
||||
(void)printf("%*ld", v->width, pgtok(KI_EPROC(k)->e_vm.vm_tsize));
|
||||
(void)printf("%*d", v->width, pgtok(KI_EPROC(k)->e_vm.vm_tsize));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -663,7 +664,7 @@ printval(bp, v)
|
||||
if (v->flag & LJUST)
|
||||
*cp++ = '-';
|
||||
*cp++ = '*';
|
||||
while ((*cp++ = *fcp++));
|
||||
while (*cp++ = *fcp++);
|
||||
|
||||
switch (v->type) {
|
||||
case CHAR:
|
||||
|
||||
+4
-18
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94
|
||||
.\" $Id: ps.1,v 1.4.6.2 1996/02/22 19:51:39 peter Exp $
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd April 18, 1994
|
||||
.Dt PS 1
|
||||
@@ -47,7 +47,6 @@
|
||||
.Op Fl o Ar fmt
|
||||
.Op Fl p Ar pid
|
||||
.Op Fl t Ar tty
|
||||
.Op Fl U Ar username
|
||||
.Op Fl W Ar swap
|
||||
.Nm ps
|
||||
.Op Fl L
|
||||
@@ -55,7 +54,7 @@
|
||||
.Nm \&Ps
|
||||
displays a header line followed by lines containing information about your
|
||||
processes that have controlling terminals.
|
||||
This information is sorted by controlling terminal, then by process
|
||||
This information is sorted by process
|
||||
.Tn ID .
|
||||
.Pp
|
||||
The information displayed is selected based on a set of keywords (see the
|
||||
@@ -69,12 +68,6 @@ The default output format includes, for each process, the process'
|
||||
controlling terminal, cpu time (including both user and system time),
|
||||
state, and associated command.
|
||||
.Pp
|
||||
The process file system (see
|
||||
.Xr procfs 5
|
||||
\&) should be mounted when
|
||||
.Nm
|
||||
is executed, otherwise not all information will be available.
|
||||
.Pp
|
||||
The options are as follows:
|
||||
.Bl -tag -width indent
|
||||
.It Fl a
|
||||
@@ -137,9 +130,6 @@ with the standard input.
|
||||
.It Fl t
|
||||
Display information about processes attached to the specified terminal
|
||||
device.
|
||||
.It Fl U
|
||||
Display the processes belonging to the specified
|
||||
.Tn username .
|
||||
.It Fl u
|
||||
Display information associated with the following keywords:
|
||||
user, pid, %cpu, %mem, vsz, rss, tt, state, start, time and command.
|
||||
@@ -488,7 +478,7 @@ wait channel (as a symbolic name)
|
||||
exit or stop status (valid only for stopped or zombie process)
|
||||
.El
|
||||
.Sh FILES
|
||||
.Bl -tag -width /var/db/kvm_kernel.db -compact
|
||||
.Bl -tag -width /var/run/kvm_kernel.db -compact
|
||||
.It Pa /dev
|
||||
special files and device names
|
||||
.It Pa /dev/drum
|
||||
@@ -497,20 +487,16 @@ default swap device
|
||||
default kernel memory
|
||||
.It Pa /var/run/dev.db
|
||||
/dev name database
|
||||
.It Pa /var/db/kvm_kernel.db
|
||||
.It Pa /var/run/kvm_kernel.db
|
||||
system namelist database
|
||||
.It Pa /kernel
|
||||
default system namelist
|
||||
.It Pa /proc
|
||||
the mount point of
|
||||
.Xr procfs 5
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr kill 1 ,
|
||||
.Xr w 1 ,
|
||||
.Xr kvm 3 ,
|
||||
.Xr strftime 3 ,
|
||||
.Xr procfs 5 ,
|
||||
.Xr pstat 8
|
||||
.Sh BUGS
|
||||
Since
|
||||
|
||||
+7
-19
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ps.c,v 1.7.4.1 1996/02/22 19:51:40 peter Exp $
|
||||
* $Id: ps.c,v 1.4 1994/10/02 08:33:31 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -62,7 +62,6 @@ static char sccsid[] = "@(#)ps.c 8.4 (Berkeley) 4/2/94";
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <pwd.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "ps.h"
|
||||
@@ -110,7 +109,6 @@ main(argc, argv)
|
||||
struct kinfo_proc *kp;
|
||||
struct varent *vent;
|
||||
struct winsize ws;
|
||||
struct passwd *pwd;
|
||||
dev_t ttydev;
|
||||
pid_t pid;
|
||||
uid_t uid;
|
||||
@@ -135,7 +133,7 @@ main(argc, argv)
|
||||
ttydev = NODEV;
|
||||
memf = nlistf = swapf = NULL;
|
||||
while ((ch = getopt(argc, argv,
|
||||
"aCeghjLlM:mN:O:o:p:rSTt:U:uvW:wx")) != EOF)
|
||||
"aCeghjLlM:mN:O:o:p:rSTt:uvW:wx")) != EOF)
|
||||
switch((char)ch) {
|
||||
case 'a':
|
||||
all = 1;
|
||||
@@ -216,14 +214,6 @@ main(argc, argv)
|
||||
ttydev = sb.st_rdev;
|
||||
break;
|
||||
}
|
||||
case 'U':
|
||||
pwd = getpwnam(optarg);
|
||||
if (pwd == NULL)
|
||||
errx(1, "%s: no such user", optarg);
|
||||
uid = pwd->pw_uid;
|
||||
endpwent();
|
||||
xflg++; /* XXX: intuitive? */
|
||||
break;
|
||||
case 'u':
|
||||
parsefmt(ufmt);
|
||||
sortby = SORTCPU;
|
||||
@@ -281,8 +271,7 @@ main(argc, argv)
|
||||
if (!fmt)
|
||||
parsefmt(dfmt);
|
||||
|
||||
/* XXX - should be cleaner */
|
||||
if (!all && ttydev == NODEV && pid == -1 && uid == (uid_t)-1)
|
||||
if (!all && ttydev == NODEV && pid == -1) /* XXX - should be cleaner */
|
||||
uid = getuid();
|
||||
|
||||
/*
|
||||
@@ -395,7 +384,7 @@ saveuser(ki)
|
||||
struct user *u_addr = (struct user *)USRSTACK;
|
||||
|
||||
usp = &ki->ki_u;
|
||||
if (kvm_uread(kd, KI_PROC(ki), (unsigned long)&u_addr->u_stats,
|
||||
if (kvm_uread(kd, KI_PROC(ki), &u_addr->u_stats,
|
||||
(char *)&pstats, sizeof(pstats)) == sizeof(pstats)) {
|
||||
/*
|
||||
* The u-area might be swapped out, and we can't get
|
||||
@@ -497,9 +486,8 @@ kludge_oldps_options(s)
|
||||
* if there's a trailing number, and not a preceding 'p' (pid) or
|
||||
* 't' (tty) flag, then assume it's a pid and insert a 'p' flag.
|
||||
*/
|
||||
if (isdigit(*cp) &&
|
||||
(cp == s || (cp[-1] != 't' && cp[-1] != 'p')) &&
|
||||
(cp - 1 == s || cp[-2] != 't'))
|
||||
if (isdigit(*cp) && (cp == s || cp[-1] != 't' && cp[-1] != 'p' &&
|
||||
(cp - 1 == s || cp[-2] != 't')))
|
||||
*ns++ = 'p';
|
||||
(void)strcpy(ns, cp); /* and append the number */
|
||||
|
||||
@@ -512,7 +500,7 @@ usage()
|
||||
|
||||
(void)fprintf(stderr,
|
||||
"usage:\t%s\n\t %s\n\t%s\n",
|
||||
"ps [-aChjlmrSTuvwx] [-O|o fmt] [-p pid] [-t tty] [-U user]",
|
||||
"ps [-aChjlmrSTuvwx] [-O|o fmt] [-p pid] [-t tty]",
|
||||
"[-M core] [-N system] [-W swap]",
|
||||
"ps [-L]");
|
||||
exit(1);
|
||||
|
||||
+1
-2
@@ -1,5 +1,5 @@
|
||||
# @(#)Makefile 8.1 (Berkeley) 7/19/93
|
||||
# $Id: Makefile,v 1.4 1994/09/29 13:06:00 csgr Exp $
|
||||
# $Id: Makefile,v 1.3 1994/09/24 02:56:53 davidg Exp $
|
||||
|
||||
PROG= rcp
|
||||
SRCS= rcp.c util.c
|
||||
@@ -11,7 +11,6 @@ SRCS+= kcmd.c krcmd.c
|
||||
CFLAGS+=-DKERBEROS -DCRYPT
|
||||
DPADD= ${LIBKRB} ${LIBDES}
|
||||
LDADD= -lkrb -ldes
|
||||
DISTRIBUTION= krb
|
||||
.endif
|
||||
|
||||
BINOWN= root
|
||||
|
||||
+13
-13
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: rcp.c,v 1.4.4.2 1996/06/05 02:36:15 jkh Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -69,7 +69,7 @@ static char sccsid[] = "@(#)rcp.c 8.2 (Berkeley) 4/2/94";
|
||||
#include "extern.h"
|
||||
|
||||
#ifdef KERBEROS
|
||||
#include <des.h>
|
||||
#include <kerberosIV/des.h>
|
||||
#include <kerberosIV/krb.h>
|
||||
|
||||
char dst_realm_buf[REALM_SZ];
|
||||
@@ -226,7 +226,7 @@ main(argc, argv)
|
||||
|
||||
(void)signal(SIGPIPE, lostconn);
|
||||
|
||||
if ((targ = colon(argv[argc - 1]))) /* Dest is remote host. */
|
||||
if (targ = colon(argv[argc - 1])) /* Dest is remote host. */
|
||||
toremote(targ, argc, argv);
|
||||
else {
|
||||
tolocal(argc, argv); /* Dest is local host. */
|
||||
@@ -248,7 +248,7 @@ toremote(targ, argc, argv)
|
||||
if (*targ == 0)
|
||||
targ = ".";
|
||||
|
||||
if ((thost = strchr(argv[argc - 1], '@'))) {
|
||||
if (thost = strchr(argv[argc - 1], '@')) {
|
||||
/* user@host */
|
||||
*thost++ = 0;
|
||||
tuser = argv[argc - 1];
|
||||
@@ -366,10 +366,10 @@ tolocal(argc, argv)
|
||||
if ((bp = malloc(len)) == NULL)
|
||||
err(1, NULL);
|
||||
(void)snprintf(bp, len, "%s -f %s", cmd, src);
|
||||
rem =
|
||||
rem =
|
||||
#ifdef KERBEROS
|
||||
use_kerberos ?
|
||||
kerberos(&host, bp, pwd->pw_name, suser) :
|
||||
use_kerberos ?
|
||||
kerberos(&host, bp, pwd->pw_name, suser) :
|
||||
#endif
|
||||
rcmd(&host, port, pwd->pw_name, suser, bp, 0);
|
||||
(void)free(bp);
|
||||
@@ -509,7 +509,7 @@ rsource(name, statp)
|
||||
closedir(dirp);
|
||||
return;
|
||||
}
|
||||
while ((dp = readdir(dirp))) {
|
||||
while (dp = readdir(dirp)) {
|
||||
if (dp->d_ino == 0)
|
||||
continue;
|
||||
if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, ".."))
|
||||
@@ -539,7 +539,7 @@ sink(argc, argv)
|
||||
BUF *bp;
|
||||
off_t i, j;
|
||||
int amt, count, exists, first, mask, mode, ofd, omode;
|
||||
int setimes, size, targisdir, wrerrno = 0;
|
||||
int setimes, size, targisdir, wrerrno;
|
||||
char ch, *cp, *np, *targ, *why, *vect[1], buf[BUFSIZ];
|
||||
|
||||
#define atime tv[0]
|
||||
@@ -714,7 +714,7 @@ bad: run_err("%s: %s", np, strerror(errno));
|
||||
j = write(ofd, bp->buf, count);
|
||||
if (j != count) {
|
||||
wrerr = YES;
|
||||
wrerrno = j >= 0 ? EIO : errno;
|
||||
wrerrno = j >= 0 ? EIO : errno;
|
||||
}
|
||||
}
|
||||
count = 0;
|
||||
@@ -724,7 +724,7 @@ bad: run_err("%s: %s", np, strerror(errno));
|
||||
if (count != 0 && wrerr == NO &&
|
||||
(j = write(ofd, bp->buf, count)) != count) {
|
||||
wrerr = YES;
|
||||
wrerrno = j >= 0 ? EIO : errno;
|
||||
wrerrno = j >= 0 ? EIO : errno;
|
||||
}
|
||||
if (ftruncate(ofd, size)) {
|
||||
run_err("%s: truncate: %s", np, strerror(errno));
|
||||
@@ -780,9 +780,9 @@ again:
|
||||
errno = 0;
|
||||
if (dest_realm == NULL)
|
||||
dest_realm = krb_realmofhost(*host);
|
||||
rem =
|
||||
rem =
|
||||
#ifdef CRYPT
|
||||
doencrypt ?
|
||||
doencrypt ?
|
||||
krcmd_mutual(host,
|
||||
port, user, bp, 0, dest_realm, &cred, schedule) :
|
||||
#endif
|
||||
|
||||
+3
-3
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: util.c,v 1.3 1995/03/19 13:29:16 joerg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -111,14 +111,14 @@ susystem(s, userid)
|
||||
char *s;
|
||||
{
|
||||
sig_t istat, qstat;
|
||||
int status;
|
||||
int status, w;
|
||||
pid_t pid;
|
||||
|
||||
pid = vfork();
|
||||
switch (pid) {
|
||||
case -1:
|
||||
return (127);
|
||||
|
||||
|
||||
case 0:
|
||||
(void)setuid(userid);
|
||||
execl(_PATH_BSHELL, "sh", "-c", s, NULL);
|
||||
|
||||
+1
-4
@@ -1,9 +1,6 @@
|
||||
# @(#)Makefile 8.1 (Berkeley) 5/31/93
|
||||
# $Id: Makefile,v 1.2 1994/09/24 02:56:59 davidg Exp $
|
||||
# $Id$
|
||||
|
||||
PROG= rm
|
||||
SRCS= rm.c stat_flags.c
|
||||
|
||||
.PATH: ${.CURDIR}/../ls
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
+1
-1
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)rm.1 8.2 (Berkeley) 4/18/94
|
||||
.\" $Id: rm.1,v 1.2 1994/09/24 02:57:00 davidg Exp $
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd April 18, 1994
|
||||
.Dt RM 1
|
||||
|
||||
+29
-64
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: rm.c,v 1.6 1995/04/13 13:35:09 ache Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -55,10 +55,7 @@ static char sccsid[] = "@(#)rm.c 8.5 (Berkeley) 4/18/94";
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
extern char *flags_to_string __P((u_long, char *));
|
||||
|
||||
int dflag, eval, fflag, iflag, Pflag, stdin_ok;
|
||||
uid_t uid;
|
||||
|
||||
int check __P((char *, char *, struct stat *));
|
||||
void checkdot __P((char **));
|
||||
@@ -117,7 +114,6 @@ main(argc, argv)
|
||||
exit (eval);
|
||||
|
||||
stdin_ok = isatty(STDIN_FILENO);
|
||||
uid = geteuid();
|
||||
|
||||
if (rflag)
|
||||
rm_tree(argv);
|
||||
@@ -133,13 +129,12 @@ rm_tree(argv)
|
||||
FTS *fts;
|
||||
FTSENT *p;
|
||||
int needstat;
|
||||
int rval;
|
||||
|
||||
/*
|
||||
* Remove a file hierarchy. If forcing removal (-f), or interactive
|
||||
* (-i) or can't ask anyway (stdin_ok), don't stat the file.
|
||||
*/
|
||||
needstat = !uid || !fflag && !iflag && stdin_ok;
|
||||
needstat = !fflag && !iflag && stdin_ok;
|
||||
|
||||
/*
|
||||
* If the -i option is specified, the user can skip on the pre-order
|
||||
@@ -182,12 +177,6 @@ rm_tree(argv)
|
||||
(void)fts_set(fts, p, FTS_SKIP);
|
||||
p->fts_number = SKIPPED;
|
||||
}
|
||||
else if (!uid &&
|
||||
(p->fts_statp->st_flags & (UF_APPEND|UF_IMMUTABLE)) &&
|
||||
!(p->fts_statp->st_flags & (SF_APPEND|SF_IMMUTABLE)) &&
|
||||
chflags(p->fts_accpath,
|
||||
p->fts_statp->st_flags &= ~(UF_APPEND|UF_IMMUTABLE)) < 0)
|
||||
goto err;
|
||||
continue;
|
||||
case FTS_DP:
|
||||
/* Post-order: see if user skipped. */
|
||||
@@ -199,34 +188,25 @@ rm_tree(argv)
|
||||
!check(p->fts_path, p->fts_accpath, p->fts_statp))
|
||||
continue;
|
||||
|
||||
rval = 0;
|
||||
if (!uid &&
|
||||
(p->fts_statp->st_flags & (UF_APPEND|UF_IMMUTABLE)) &&
|
||||
!(p->fts_statp->st_flags & (SF_APPEND|SF_IMMUTABLE)))
|
||||
rval = chflags(p->fts_accpath,
|
||||
p->fts_statp->st_flags &= ~(UF_APPEND|UF_IMMUTABLE));
|
||||
if (!rval) {
|
||||
/*
|
||||
* If we can't read or search the directory, may still be
|
||||
* able to remove it. Don't print out the un{read,search}able
|
||||
* message unless the remove fails.
|
||||
*/
|
||||
if (p->fts_info == FTS_DP || p->fts_info == FTS_DNR) {
|
||||
if (!rmdir(p->fts_accpath))
|
||||
/*
|
||||
* If we can't read or search the directory, may still be
|
||||
* able to remove it. Don't print out the un{read,search}able
|
||||
* message unless the remove fails.
|
||||
*/
|
||||
if (p->fts_info == FTS_DP || p->fts_info == FTS_DNR) {
|
||||
if (!rmdir(p->fts_accpath))
|
||||
continue;
|
||||
if (errno == ENOENT) {
|
||||
if (fflag)
|
||||
continue;
|
||||
if (errno == ENOENT) {
|
||||
if (fflag)
|
||||
continue;
|
||||
} else if (p->fts_info != FTS_DP)
|
||||
warnx("%s: unable to read", p->fts_path);
|
||||
} else {
|
||||
if (Pflag)
|
||||
rm_overwrite(p->fts_accpath, NULL);
|
||||
if (!unlink(p->fts_accpath) || (fflag && errno == ENOENT))
|
||||
continue;
|
||||
}
|
||||
} else if (p->fts_info != FTS_DP)
|
||||
warnx("%s: unable to read", p->fts_path);
|
||||
} else {
|
||||
if (Pflag)
|
||||
rm_overwrite(p->fts_accpath, NULL);
|
||||
if (!unlink(p->fts_accpath) || (fflag && errno == ENOENT))
|
||||
continue;
|
||||
}
|
||||
err:
|
||||
warn("%s", p->fts_path);
|
||||
eval = 1;
|
||||
}
|
||||
@@ -263,19 +243,12 @@ rm_file(argv)
|
||||
}
|
||||
if (!fflag && !check(f, f, &sb))
|
||||
continue;
|
||||
rval = 0;
|
||||
if (!uid &&
|
||||
(sb.st_flags & (UF_APPEND|UF_IMMUTABLE)) &&
|
||||
!(sb.st_flags & (SF_APPEND|SF_IMMUTABLE)))
|
||||
rval = chflags(f, sb.st_flags & ~(UF_APPEND|UF_IMMUTABLE));
|
||||
if (!rval) {
|
||||
if (S_ISDIR(sb.st_mode))
|
||||
rval = rmdir(f);
|
||||
else {
|
||||
if (Pflag)
|
||||
rm_overwrite(f, &sb);
|
||||
rval = unlink(f);
|
||||
}
|
||||
if (S_ISDIR(sb.st_mode))
|
||||
rval = rmdir(f);
|
||||
else {
|
||||
if (Pflag)
|
||||
rm_overwrite(f, &sb);
|
||||
rval = unlink(f);
|
||||
}
|
||||
if (rval && (!fflag || errno != ENOENT)) {
|
||||
warn("%s", f);
|
||||
@@ -345,7 +318,7 @@ check(path, name, sp)
|
||||
struct stat *sp;
|
||||
{
|
||||
int ch, first;
|
||||
char modep[15], flagsp[128];
|
||||
char modep[15];
|
||||
|
||||
/* Check -i first. */
|
||||
if (iflag)
|
||||
@@ -357,21 +330,13 @@ check(path, name, sp)
|
||||
* because their permissions are meaningless. Check stdin_ok
|
||||
* first because we may not have stat'ed the file.
|
||||
*/
|
||||
if (!stdin_ok || S_ISLNK(sp->st_mode) ||
|
||||
!access(name, W_OK) &&
|
||||
!(sp->st_flags & (SF_APPEND|SF_IMMUTABLE)) &&
|
||||
(!(sp->st_flags & (UF_APPEND|UF_IMMUTABLE)) || !uid))
|
||||
if (!stdin_ok || S_ISLNK(sp->st_mode) || !access(name, W_OK))
|
||||
return (1);
|
||||
strmode(sp->st_mode, modep);
|
||||
strcpy(flagsp, flags_to_string(sp->st_flags, NULL));
|
||||
if (*flagsp)
|
||||
strcat(flagsp, " ");
|
||||
(void)fprintf(stderr, "override %s%s%s/%s %sfor %s? ",
|
||||
(void)fprintf(stderr, "override %s%s%s/%s for %s? ",
|
||||
modep + 1, modep[9] == ' ' ? "" : " ",
|
||||
user_from_uid(sp->st_uid, 0),
|
||||
group_from_gid(sp->st_gid, 0),
|
||||
*flagsp ? flagsp : "",
|
||||
path);
|
||||
group_from_gid(sp->st_gid, 0), path);
|
||||
}
|
||||
(void)fflush(stderr);
|
||||
|
||||
|
||||
+1
-5
@@ -1,11 +1,7 @@
|
||||
# @(#)Makefile 8.1 (Berkeley) 5/31/93
|
||||
# $Id: Makefile,v 1.3 1994/09/24 02:57:03 davidg Exp $
|
||||
# $Id$
|
||||
|
||||
PROG= rmail
|
||||
MAN8= rmail.8
|
||||
|
||||
# If you want to have your rmail queuing the mail only, uncomment the
|
||||
# following:
|
||||
# CFLAGS+= -DQUEUE_ONLY
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
+2
-8
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: rmail.c,v 1.5 1995/05/30 00:07:08 rgrimes Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -48,7 +48,7 @@ static char sccsid[] = "@(#)rmail.c 8.1 (Berkeley) 5/31/93";
|
||||
*
|
||||
* This program reads the >From ... remote from ... lines that UUCP is so
|
||||
* fond of and turns them into something reasonable. It then execs sendmail
|
||||
* with various options built from these lines.
|
||||
* with various options built from these lines.
|
||||
*
|
||||
* The expected syntax is:
|
||||
*
|
||||
@@ -119,8 +119,6 @@ main(argc, argv)
|
||||
if (argc < 1)
|
||||
usage();
|
||||
|
||||
fplen = fptlen = 0;
|
||||
addrp = "";
|
||||
from_path = from_sys = from_user = NULL;
|
||||
for (offset = 0;;) {
|
||||
|
||||
@@ -230,11 +228,7 @@ main(argc, argv)
|
||||
i = 0;
|
||||
args[i++] = _PATH_SENDMAIL; /* Build sendmail's argument list. */
|
||||
args[i++] = "-oee"; /* No errors, just status. */
|
||||
#ifdef QUEUE_ONLY
|
||||
args[i++] = "-odq"; /* Queue it, don't try to deliver. */
|
||||
#else
|
||||
args[i++] = "-odi"; /* Deliver in foreground. */
|
||||
#endif
|
||||
args[i++] = "-oi"; /* Ignore '.' on a line by itself. */
|
||||
|
||||
if (from_sys != NULL) { /* Set sender's host name. */
|
||||
|
||||
+1
-6
@@ -1,5 +1,5 @@
|
||||
# @(#)Makefile 8.1 (Berkeley) 6/8/93
|
||||
# $Id: Makefile,v 1.7.6.3 1996/06/05 02:36:21 jkh Exp $
|
||||
# $Id: Makefile,v 1.6 1994/09/24 02:57:18 davidg Exp $
|
||||
|
||||
PROG= sh
|
||||
SRCS= alias.c builtins.c cd.c echo.c error.c eval.c exec.c expand.c \
|
||||
@@ -11,8 +11,6 @@ DPADD= ${LIBL} ${LIBEDIT} ${LIBTERMCAP}
|
||||
LDADD= -ll -ledit -ltermcap
|
||||
LFLAGS= -8 # 8-bit lex scanner for arithmetic
|
||||
CFLAGS+=-DSHELL -I. -I${.CURDIR}
|
||||
# for debugging:
|
||||
#CFLAGS+=-g -DDEBUG=2
|
||||
.PATH: ${.CURDIR}/bltin ${.CURDIR}/../../usr.bin/printf
|
||||
CLEANFILES+=\
|
||||
builtins.c builtins.h init.c mkinit mknodes mksignames mksyntax \
|
||||
@@ -23,9 +21,6 @@ CLEANFILES+=\
|
||||
token.def: mktokens
|
||||
sh ${.CURDIR}/mktokens
|
||||
|
||||
${.CURDIR}/builtins:
|
||||
# just override the default rule
|
||||
|
||||
builtins.h builtins.c: ${.CURDIR}/mkbuiltins ${.CURDIR}/builtins
|
||||
cd ${.CURDIR}; sh mkbuiltins
|
||||
|
||||
|
||||
+2
-2
@@ -33,7 +33,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: alias.c,v 1.2 1994/09/24 02:57:20 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -227,7 +227,7 @@ unaliascmd(argc, argv)
|
||||
char **argv;
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
while ((i = nextopt("a")) != '\0') {
|
||||
if (i == 'a') {
|
||||
rmaliases();
|
||||
|
||||
+1
-10
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)bltin.h 8.1 (Berkeley) 5/31/93
|
||||
* $Id: bltin.h,v 1.2.6.1 1995/12/11 23:05:26 joerg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -47,24 +47,15 @@
|
||||
#include "../mystring.h"
|
||||
#ifdef SHELL
|
||||
#include "../output.h"
|
||||
#undef stdout
|
||||
#define stdout out1
|
||||
#undef stderr
|
||||
#define stderr out2
|
||||
#define printf out1fmt
|
||||
#undef putc
|
||||
#define putc(c, file) outc(c, file)
|
||||
#undef putchar
|
||||
#define putchar(c) out1c(c)
|
||||
#define fprintf outfmt
|
||||
#define fputs outstr
|
||||
#define fflush flushout
|
||||
#define INITARGS(argv)
|
||||
#define warnx(a, b, c) { \
|
||||
char buf[64]; \
|
||||
(void)snprintf(buf, sizeof(buf), a, b, c); \
|
||||
error(buf); \
|
||||
}
|
||||
#else
|
||||
#undef NULL
|
||||
#include <stdio.h>
|
||||
|
||||
+1
-4
@@ -34,16 +34,13 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)echo.c 8.1 (Berkeley) 5/31/93
|
||||
* $Id: echo.c,v 1.2 1994/09/24 02:58:29 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Echo command.
|
||||
*/
|
||||
|
||||
#ifdef main
|
||||
#undef main
|
||||
#endif
|
||||
#define main echocmd
|
||||
|
||||
#include "bltin.h"
|
||||
|
||||
+1
-2
@@ -35,7 +35,7 @@
|
||||
# SUCH DAMAGE.
|
||||
#
|
||||
# @(#)builtins 8.1 (Berkeley) 5/31/93
|
||||
# $Id: builtins,v 1.3 1995/10/19 18:42:09 joerg Exp $
|
||||
# $Id$
|
||||
|
||||
#
|
||||
# This file lists all the builtin commands. The first column is the name
|
||||
@@ -83,7 +83,6 @@ setvarcmd setvar
|
||||
shiftcmd shift
|
||||
trapcmd trap
|
||||
truecmd : true
|
||||
ulimitcmd ulimit
|
||||
umaskcmd umask
|
||||
unaliascmd unalias
|
||||
unsetcmd unset
|
||||
|
||||
+3
-8
@@ -33,7 +33,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: cd.c,v 1.5 1995/11/14 01:04:52 peter Exp $
|
||||
* $Id: cd.c,v 1.2 1994/09/24 02:57:24 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -88,14 +88,9 @@ cdcmd(argc, argv) char **argv; {
|
||||
nextopt(nullstr);
|
||||
if ((dest = *argptr) == NULL && (dest = bltinlookup("HOME", 1)) == NULL)
|
||||
error("HOME not set");
|
||||
if (*dest == '\0')
|
||||
dest = ".";
|
||||
if (dest[0] == '-' && dest[1] == '\0') {
|
||||
dest = prevdir ? prevdir : curdir;
|
||||
if (dest)
|
||||
print = 1;
|
||||
else
|
||||
dest = ".";
|
||||
print = 1;
|
||||
}
|
||||
if (*dest == '/' || (path = bltinlookup("CDPATH", 1)) == NULL)
|
||||
path = nullstr;
|
||||
@@ -225,7 +220,7 @@ top:
|
||||
STPUTC('\0', p);
|
||||
p = grabstackstr(p);
|
||||
INTOFF;
|
||||
if (chdir(*p ? p : ".") < 0) {
|
||||
if (chdir(p) < 0) {
|
||||
INTON;
|
||||
return -1;
|
||||
}
|
||||
|
||||
+2
-2
@@ -33,7 +33,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: error.c,v 1.2 1994/09/24 02:57:27 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -53,7 +53,7 @@ static char sccsid[] = "@(#)error.c 8.1 (Berkeley) 5/31/93";
|
||||
#ifdef __STDC__
|
||||
#include "stdarg.h"
|
||||
#else
|
||||
#include <varargs.h>
|
||||
#include <varargs.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
+5
-6
@@ -33,7 +33,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: eval.c,v 1.3 1995/05/30 00:07:11 rgrimes Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -134,8 +134,8 @@ SHELLPROC {
|
||||
* The eval commmand.
|
||||
*/
|
||||
|
||||
evalcmd(argc, argv)
|
||||
char **argv;
|
||||
evalcmd(argc, argv)
|
||||
char **argv;
|
||||
{
|
||||
char *p;
|
||||
char *concat;
|
||||
@@ -233,7 +233,7 @@ evaltree(n, flags)
|
||||
evalsubshell(n, flags);
|
||||
break;
|
||||
case NIF: {
|
||||
int status = 0;
|
||||
int status = 0;
|
||||
|
||||
evaltree(n->nif.test, EV_TESTED);
|
||||
if (evalskip)
|
||||
@@ -851,8 +851,7 @@ prehash(n)
|
||||
{
|
||||
struct cmdentry entry;
|
||||
|
||||
if (n->type == NCMD && n->ncmd.args &&
|
||||
goodname(n->ncmd.args->narg.text))
|
||||
if (n->type == NCMD && goodname(n->ncmd.args->narg.text))
|
||||
find_command(n->ncmd.args->narg.text, &entry, 0);
|
||||
}
|
||||
|
||||
|
||||
Loaded 100 of 8234 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user