diff --git a/bin/sh/miscbltin.c b/bin/sh/miscbltin.c index be7f0f793702..414ed81a164f 100644 --- a/bin/sh/miscbltin.c +++ b/bin/sh/miscbltin.c @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: miscbltin.c,v 1.2 1994/09/24 02:57:52 davidg Exp $ + * $Id: miscbltin.c,v 1.3 1995/10/19 18:42:10 joerg Exp $ */ #ifndef lint @@ -209,7 +209,7 @@ static struct restab restab[] = { {RLIMIT_FSIZE, 512, "filesize(512-blocks) "}, {RLIMIT_MEMLOCK, 1024, "lockedmem(kilobytes) "}, {RLIMIT_NOFILE, 1, "nofiles(descriptors) "}, - {RLIMIT_NPROC, 1, "processes(max) "}, + {RLIMIT_NPROC, 1, "userprocs(max) "}, {RLIMIT_RSS, 1024, "memoryuse(kilobytes) "}, {RLIMIT_STACK, 1024, "stacksize(kilobytes) "} }; @@ -265,7 +265,7 @@ ulimitcmd(argc, argv) char **argv; { opterr = 0; /* use own error processing */ optreset = 1; optind = 1; - while ((i = getopt(argc, argv, "HSacdfnstmlp")) != EOF) { + while ((i = getopt(argc, argv, "HSacdfnstmlu")) != EOF) { arg++; switch(i) { case 'H': @@ -313,7 +313,7 @@ ulimitcmd(argc, argv) char **argv; { if(resource != RLIMIT_UNSPEC) errs++; resource = RLIMIT_MEMLOCK; break; - case 'p': + case 'u': if(resource != RLIMIT_UNSPEC) errs++; resource = RLIMIT_NPROC; break; diff --git a/bin/sh/redir.c b/bin/sh/redir.c index efd1d3af2ee3..47f964f26941 100644 --- a/bin/sh/redir.c +++ b/bin/sh/redir.c @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: redir.c,v 1.2 1994/09/24 02:58:10 davidg Exp $ + * $Id: redir.c,v 1.3 1995/05/30 00:07:22 rgrimes Exp $ */ #ifndef lint @@ -120,6 +120,9 @@ redirect(redir, flags) } for (n = redir ; n ; n = n->nfile.next) { fd = n->nfile.fd; + if ((n->nfile.type == NTOFD || n->nfile.type == NFROMFD) && + n->ndup.dupfd == fd) + continue; /* redirect from/to myself */ if ((flags & REDIR_PUSH) && sv->renamed[fd] == EMPTY) { INTOFF; if ((i = copyfd(fd, 10)) != EMPTY) { @@ -341,5 +344,7 @@ copyfd(from, to) { newfd = fcntl(from, F_DUPFD, to); if (newfd < 0 && errno == EMFILE) return EMPTY; + if (newfd < 0) + error("%d: %s", from, strerror(errno)); return newfd; } diff --git a/bin/sh/sh.1 b/bin/sh/sh.1 index a5201a253130..7b649feccf3b 100644 --- a/bin/sh/sh.1 +++ b/bin/sh/sh.1 @@ -33,7 +33,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)sh.1 8.4 (Berkeley) 4/18/94 -.\" $Id: sh.1,v 1.3 1995/05/05 16:49:15 adam Exp $ +.\" $Id: sh.1,v 1.4 1995/10/19 18:42:12 joerg Exp $ .\" .\" .\" @@ -1319,7 +1319,7 @@ The maximal resident set size of a process, in kilobytes. -n nofiles The maximal number of descriptors that could be opened by a process. .TP 2 --p procmax +-u userproc The maximal number of simultaneous processes for this user ID. .TP 2 -s stacksize