diff options
author | pav <pav@FreeBSD.org> | 2009-01-07 01:59:31 +0800 |
---|---|---|
committer | pav <pav@FreeBSD.org> | 2009-01-07 01:59:31 +0800 |
commit | 8ef21a396d8627cdfced24744c2bacb7cb0c9453 (patch) | |
tree | 06fbb407306ac7e1b7b00946df69737e787c8891 /shells/v7sh | |
parent | e32973556a174646ad93cdf1b43963a9fc18eb55 (diff) | |
download | freebsd-ports-gnome-8ef21a396d8627cdfced24744c2bacb7cb0c9453.tar.gz freebsd-ports-gnome-8ef21a396d8627cdfced24744c2bacb7cb0c9453.tar.zst freebsd-ports-gnome-8ef21a396d8627cdfced24744c2bacb7cb0c9453.zip |
- Remove conditional checks for FreeBSD 5.x and older
Diffstat (limited to 'shells/v7sh')
-rw-r--r-- | shells/v7sh/Makefile | 3 | ||||
-rw-r--r-- | shells/v7sh/files/Makefile | 3 | ||||
-rw-r--r-- | shells/v7sh/files/ulimit.c | 68 | ||||
-rw-r--r-- | shells/v7sh/files/ulimit.h | 41 |
4 files changed, 0 insertions, 115 deletions
diff --git a/shells/v7sh/Makefile b/shells/v7sh/Makefile index fb509a8ccd45..209ac769f491 100644 --- a/shells/v7sh/Makefile +++ b/shells/v7sh/Makefile @@ -52,9 +52,6 @@ post-extract: @${CP} ${FILESDIR}/Makefile ${WRKSRC} @${CP} ${FILESDIR}/test.c ${WRKSRC} # sysIII @${CP} ${FILESDIR}/pathnames.h ${WRKSRC} # 43reno -.if ${OSVERSION} < 500005 - @${CP} ${FILESDIR}/ulimit.[ch] ${WRKSRC} # fbsd52 -.endif post-install: @${ECHO_MSG} "updating /etc/shells" diff --git a/shells/v7sh/files/Makefile b/shells/v7sh/files/Makefile index 845674f69a02..2c8426a75149 100644 --- a/shells/v7sh/files/Makefile +++ b/shells/v7sh/files/Makefile @@ -8,9 +8,6 @@ PROG= v7sh SRCS= args.c blok.c builtin.c cmd.c ctype.c error.c expand.c \ fault.c io.c macro.c main.c msg.c name.c print.c service.c \ setbrk.c stak.c string.c test.c word.c xec.c -.if ${OSVERSION} < 500005 -SRCS+= ulimit.c -.endif #CFLAGS+= -DSYSIII #CFLAGS+= -DRENO diff --git a/shells/v7sh/files/ulimit.c b/shells/v7sh/files/ulimit.c deleted file mode 100644 index 97b686c0bf04..000000000000 --- a/shells/v7sh/files/ulimit.c +++ /dev/null @@ -1,68 +0,0 @@ -/*- - * Copyright (c) 2002 Kyle Martin <mkm@ieee.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from FreeBSD: /repoman/r/ncvs/src/lib/libc/gen/ulimit.c,v 1.1.2.1 2003/01/08 01:23:00 tjr Exp $ - */ - -#include <sys/types.h> -#include <sys/time.h> -#include <sys/resource.h> - -#include <errno.h> -#include <limits.h> -#include <stdarg.h> -#include "ulimit.h" - -long -ulimit(int cmd, ...) -{ - struct rlimit limit; - va_list ap; - long arg; - - if (cmd == UL_GETFSIZE) { - if (getrlimit(RLIMIT_FSIZE, &limit) == -1) - return (-1); - limit.rlim_cur /= 512; - if (limit.rlim_cur > LONG_MAX) - return (LONG_MAX); - return ((long)limit.rlim_cur); - } else if (cmd == UL_SETFSIZE) { - va_start(ap, cmd); - arg = va_arg(ap, long); - va_end(ap); - limit.rlim_max = limit.rlim_cur = (rlim_t)arg * 512; - - /* The setrlimit() function sets errno to EPERM if needed. */ - if (setrlimit(RLIMIT_FSIZE, &limit) == -1) - return (-1); - if (arg * 512 > LONG_MAX) - return (LONG_MAX); - return (arg); - } else { - errno = EINVAL; - return (-1); - } -} diff --git a/shells/v7sh/files/ulimit.h b/shells/v7sh/files/ulimit.h deleted file mode 100644 index c72cd0e2dca2..000000000000 --- a/shells/v7sh/files/ulimit.h +++ /dev/null @@ -1,41 +0,0 @@ -/*- - * Copyright (c) 2002 Kyle Martin <mkm@ieee.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from FreeBSD: /repoman/r/ncvs/src/include/ulimit.h,v 1.1.2.1 2003/01/08 01:23:00 tjr Exp $ - */ - -#ifndef _ULIMIT_H_ -#define _ULIMIT_H_ - -#include <sys/cdefs.h> - -#define UL_GETFSIZE 1 -#define UL_SETFSIZE 2 - -__BEGIN_DECLS -long ulimit(int, ...); -__END_DECLS - -#endif /* !_ULIMIT_H_ */ |