summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1995-10-21 00:47:32 +0000
committerjoerg <joerg@FreeBSD.org>1995-10-21 00:47:32 +0000
commit8deb9482ef65a6a3a773ac996395624316ba29cc (patch)
tree7f0e2b4fc502147d3a8088d2f968895f03e09628 /bin
parente22d8066c4c8851a3d1ce3cc8c5e5393cc6d148b (diff)
downloadFreeBSD-src-8deb9482ef65a6a3a773ac996395624316ba29cc.zip
FreeBSD-src-8deb9482ef65a6a3a773ac996395624316ba29cc.tar.gz
o rename ulimit -p into ulimit -u, so we are in agreement with bash
o fix brokeness for 1>&5 redirection, where `5' was an invalid file descriptor, but no error message has been generated o fix brokeness for redirect to/from myself case
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/miscbltin.c8
-rw-r--r--bin/sh/redir.c7
-rw-r--r--bin/sh/sh.14
3 files changed, 12 insertions, 7 deletions
diff --git a/bin/sh/miscbltin.c b/bin/sh/miscbltin.c
index be7f0f7..414ed81 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 efd1d3a..47f964f 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 a5201a2..7b649fe 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
OpenPOWER on IntegriCloud