summaryrefslogtreecommitdiff
path: root/sys/lib/libsa/exec.c
diff options
context:
space:
mode:
authormycroft <mycroft@NetBSD.org>1995-02-21 07:14:37 +0000
committermycroft <mycroft@NetBSD.org>1995-02-21 07:14:37 +0000
commitd031ff677c23741fa706335a856c93b3567d42ab (patch)
tree17be46054b900d1d67f3360f4343d0bc3f08d3b4 /sys/lib/libsa/exec.c
parent2af23945b33e8d745b505865e3f87a04a62f2060 (diff)
exec() doesn't need to return a value.
Diffstat (limited to 'sys/lib/libsa/exec.c')
-rw-r--r--sys/lib/libsa/exec.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/sys/lib/libsa/exec.c b/sys/lib/libsa/exec.c
index 779c7f90f10..bfc1ad4545f 100644
--- a/sys/lib/libsa/exec.c
+++ b/sys/lib/libsa/exec.c
@@ -1,4 +1,4 @@
-/* $NetBSD: exec.c,v 1.6 1995/02/21 06:56:06 mycroft Exp $ */
+/* $NetBSD: exec.c,v 1.7 1995/02/21 07:14:37 mycroft Exp $ */
/*-
* Copyright (c) 1982, 1986, 1990, 1993
@@ -47,7 +47,7 @@ static char *ssym, *esym;
extern u_int opendev;
-int
+void
exec(path, loadaddr, howto)
char *path;
char *loadaddr;
@@ -61,19 +61,17 @@ exec(path, loadaddr, howto)
int i;
register char *addr;
- if (machdep_exec(path, loadaddr, howto) < 0)
- return (-1);
-
io = open(path, 0);
if (io < 0)
- return (-1);
+ return;
#ifndef INSECURE
(void) fstat(io, &sb);
if (sb.st_uid || (sb.st_mode & 2)) {
printf("non-secure file, will not load\n");
close(io);
- return (-1);
+ errno = EPERM;
+ return;
}
#endif
@@ -82,7 +80,7 @@ exec(path, loadaddr, howto)
N_BADMAG(x)) {
printf("exec: %s: Bad format\n", path);
errno = ENOEXEC;
- return (-1);
+ return;
}
/* Text */
@@ -157,11 +155,11 @@ exec(path, loadaddr, howto)
/* exec failed */
printf("%s: Cannot exec\n", path);
errno = ENOEXEC;
- return (-1);
+ return;
shread:
close(io);
printf("%s: Short read\n", path);
errno = EIO;
- return (-1);
+ return;
}