SCCS-vsn: bin/csh/lex.c 8.2
SCCS-vsn: bin/csh/dol.c 8.2
SCCS-vsn: bin/csh/csh.c 8.4
SCCS-vsn: bin/csh/csh.h 8.2
SCCS-vsn: bin/csh/dir.c 8.2
SCCS-vsn: bin/csh/sem.c 8.3
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)csh.c 8.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)csh.c 8.4 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
(void) sigaction(SIGTERM, NULL, &oact);
parterm = oact.sa_handler;
(void) sigaction(SIGTERM, NULL, &oact);
parterm = oact.sa_handler;
- if (loginsh) {
- (void) signal(SIGHUP, phup); /* exit processing on HUP */
- (void) signal(SIGXCPU, phup); /* ...and on XCPU */
- (void) signal(SIGXFSZ, phup); /* ...and on XFSZ */
- }
+ (void) signal(SIGHUP, phup); /* exit processing on HUP */
+ (void) signal(SIGXCPU, phup); /* ...and on XCPU */
+ (void) signal(SIGXFSZ, phup); /* ...and on XFSZ */
/*
* Process the arguments.
/*
* Process the arguments.
sigprocmask(SIG_BLOCK, &sigset, &osigset);
}
/* Setup the new values of the state stuff saved above */
sigprocmask(SIG_BLOCK, &sigset, &osigset);
}
/* Setup the new values of the state stuff saved above */
- bcopy((char *) &B, (char *) &(saveB), sizeof(B));
+ memmove(&saveB, &B, sizeof(B));
fbuf = NULL;
fseekp = feobp = fblocks = 0;
oSHIN = SHIN, SHIN = unit, arginp = 0, onelflg = 0;
fbuf = NULL;
fseekp = feobp = fblocks = 0;
oSHIN = SHIN, SHIN = unit, arginp = 0, onelflg = 0;
xfree((ptr_t) fbuf);
/* Reset input arena */
xfree((ptr_t) fbuf);
/* Reset input arena */
- bcopy((char *) &(saveB), (char *) &B, sizeof(B));
+ memmove(&B, &saveB, sizeof(B));
(void) close(SHIN), SHIN = oSHIN;
arginp = oarginp, onelflg = oonelflg;
(void) close(SHIN), SHIN = oSHIN;
arginp = oarginp, onelflg = oonelflg;
(void) Strcat(buf, STRsldthist);
}
(void) Strcat(buf, STRsldthist);
}
- if ((fp = creat(short2str(hfile), 0600)) == -1)
+ if ((fp = open(short2str(hfile), O_WRONLY | O_CREAT | O_TRUNC,
+ 0600)) == -1)
return;
oldidfds = didfds;
return;
oldidfds = didfds;
while ((np = np->p_friends) != pp);
}
}
while ((np = np->p_friends) != pp);
}
}
}
Char *jobargv[2] = {STRjobs, 0};
}
Char *jobargv[2] = {STRjobs, 0};
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)csh.h 8.1 (Berkeley) %G%
+ * @(#)csh.h 8.2 (Berkeley) %G%
#define setexit() (setjmp(reslab))
#define reset() longjmp(reslab, 1)
/* Should use structure assignment here */
#define setexit() (setjmp(reslab))
#define reset() longjmp(reslab, 1)
/* Should use structure assignment here */
-#define getexit(a) bcopy((char *)reslab, ((char *)(a)), sizeof reslab)
-#define resexit(a) bcopy((char *)(a), (char *)reslab, sizeof reslab)
+#define getexit(a) memmove((a), reslab, sizeof reslab)
+#define resexit(a) memmove(reslab, (a), sizeof reslab)
Char *gointr; /* Label for an onintr transfer */
Char *gointr; /* Label for an onintr transfer */
-static char sccsid[] = "@(#)dir.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) %G%";
#endif /* not lint */
#include <sys/param.h>
#endif /* not lint */
#include <sys/param.h>
static char *emsg = "csh: Trying to start from \"%s\"\n";
/* Don't believe the login shell home, because it may be a symlink */
static char *emsg = "csh: Trying to start from \"%s\"\n";
/* Don't believe the login shell home, because it may be a symlink */
- tcp = getwd(path); /* see ngetwd.c for System V version */
+ tcp = getcwd(path, MAXPATHLEN);
if (tcp == NULL || *tcp == '\0') {
if (tcp == NULL || *tcp == '\0') {
- (void) fprintf(csherr, "csh: %s\n", path);
+ (void) fprintf(csherr, "csh: %s\n", strerror(errno));
if (hp && *hp) {
tcp = short2str(hp);
if (chdir(tcp) == -1)
if (hp && *hp) {
tcp = short2str(hp);
if (chdir(tcp) == -1)
-static char sccsid[] = "@(#)dol.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)dol.c 8.2 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
- if (creat(tmp = short2str(shtemp), 0600) < 0)
+ tmp = short2str(shtemp);
+ if (open(tmp, O_RDWR | O_CREAT | O_TRUNC, 0600) < 0)
stderror(ERR_SYSTEM, tmp, strerror(errno));
stderror(ERR_SYSTEM, tmp, strerror(errno));
- (void) close(0);
- if (open(tmp, O_RDWR) < 0) {
- int oerrno = errno;
-
- (void) unlink(tmp);
- errno = oerrno;
- stderror(ERR_SYSTEM, tmp, strerror(errno));
- }
(void) unlink(tmp); /* 0 0 inode! */
Dv[0] = term;
Dv[1] = NULL;
(void) unlink(tmp); /* 0 0 inode! */
Dv[0] = term;
Dv[1] = NULL;
-static char sccsid[] = "@(#)lex.c 8.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)lex.c 8.2 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
- bcopy(ttyline, fbuf[buf] + off, c * sizeof(Char));
+ memmove(fbuf[buf] + off, ttyline, c * sizeof(Char));
-static char sccsid[] = "@(#)sem.c 8.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)sem.c 8.3 (Berkeley) %G%";
#endif /* not lint */
#include <sys/param.h>
#endif /* not lint */
#include <sys/param.h>
stderror(ERR_SYSTEM, tmp, strerror(errno));
chkclob(tmp);
}
stderror(ERR_SYSTEM, tmp, strerror(errno));
chkclob(tmp);
}
- if ((fd = creat(tmp, 0666)) < 0)
+ if ((fd = open(tmp, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0)
stderror(ERR_SYSTEM, tmp, strerror(errno));
}
(void) dmove(fd, 1);
stderror(ERR_SYSTEM, tmp, strerror(errno));
}
(void) dmove(fd, 1);