diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-01-24 05:24:08 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-01-24 05:24:08 +0000 |
commit | 77154f0d3697c72da0efcc704c15533e6dd1840d (patch) | |
tree | 10bcb6845c462c2aeee7f1adf392f173a370679f | |
parent | 7368f4ae68972ddb7ddb7a31111f0344e34c5fc0 (diff) |
remove irrelevant error handling in loadrandom; this operates on the
principe of fire and forget, and we really want developers to start
trying to write per-architecture XOR thingies using timers and such
-rw-r--r-- | sys/stand/boot/boot.c | 18 | ||||
-rw-r--r-- | sys/stand/boot/bootarg.h | 4 |
2 files changed, 7 insertions, 15 deletions
diff --git a/sys/stand/boot/boot.c b/sys/stand/boot/boot.c index 1ef4d1911d8..f27dc84b478 100644 --- a/sys/stand/boot/boot.c +++ b/sys/stand/boot/boot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: boot.c,v 1.40 2014/01/24 04:52:59 deraadt Exp $ */ +/* $OpenBSD: boot.c,v 1.41 2014/01/24 05:24:07 deraadt Exp $ */ /* * Copyright (c) 2003 Dale Rahn @@ -89,9 +89,7 @@ boot(dev_t bootdev) } while(!getcmd()); } - st = loadrandom(BOOTRANDOM, rnddata, sizeof(rnddata)); - if (st) - printf("loadrandom: error %d\n", st); + loadrandom(BOOTRANDOM, rnddata, sizeof(rnddata)); #ifdef MDRANDOM mdrandom(rnddata, sizeof(rnddata)); #endif @@ -125,7 +123,7 @@ boot(dev_t bootdev) run_loadfile(marks, cmd.boothowto); } -int +void loadrandom(char *name, char *buf, size_t buflen) { char path[MAXPATHLEN]; @@ -149,20 +147,14 @@ loadrandom(char *name, char *buf, size_t buflen) fd = open(path, O_RDONLY); if (fd == -1) { - if (errno == ENXIO || errno == ENOENT) - return -1; printf("cannot open %s: %s\n", path, strerror(errno)); - return -1; + return; } if (fstat(fd, &sb) == -1 || sb.st_uid != 0 || (sb.st_mode & (S_IWOTH|S_IROTH))) goto fail; - if (read(fd, buf, buflen) != buflen) - goto fail; - close(fd); - return 0; + (void) read(fd, buf, buflen); fail: close(fd); - return (-1); } diff --git a/sys/stand/boot/bootarg.h b/sys/stand/boot/bootarg.h index a8a40bfc99f..26b232e40ca 100644 --- a/sys/stand/boot/bootarg.h +++ b/sys/stand/boot/bootarg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bootarg.h,v 1.12 2013/12/28 02:51:07 deraadt Exp $ */ +/* $OpenBSD: bootarg.h,v 1.13 2014/01/24 05:24:07 deraadt Exp $ */ /* * Copyright (c) 1996-1999 Michael Shalayeff @@ -49,7 +49,7 @@ extern int bootargc; extern bootarg_t *bootargp; #endif -int loadrandom(char *name, char *buf, size_t buflen); +void loadrandom(char *name, char *buf, size_t buflen); int mdrandom(char *buf, size_t buflen); #ifdef _STANDALONE |