diff options
| author | 2019-06-28 13:32:41 +0000 | |
|---|---|---|
| committer | 2019-06-28 13:32:41 +0000 | |
| commit | df69c215c7c66baf660f3f65414fd34796c96152 (patch) | |
| tree | 0255639162b24c4a2f761a274e32b69c2256fd45 /usr.sbin/installboot/bootstrap.c | |
| parent | miniroot prototype disklabels should attempt to contain accurate (diff) | |
| download | wireguard-openbsd-df69c215c7c66baf660f3f65414fd34796c96152.tar.xz wireguard-openbsd-df69c215c7c66baf660f3f65414fd34796c96152.zip | |
When system calls indicate an error they return -1, not some arbitrary
value < 0. errno is only updated in this case. Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.
Diffstat (limited to 'usr.sbin/installboot/bootstrap.c')
| -rw-r--r-- | usr.sbin/installboot/bootstrap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/installboot/bootstrap.c b/usr.sbin/installboot/bootstrap.c index 4a957cc26e5..19332ff487d 100644 --- a/usr.sbin/installboot/bootstrap.c +++ b/usr.sbin/installboot/bootstrap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bootstrap.c,v 1.12 2018/12/13 14:06:10 krw Exp $ */ +/* $OpenBSD: bootstrap.c,v 1.13 2019/06/28 13:32:48 deraadt Exp $ */ /* * Copyright (c) 2013 Joel Sing <jsing@openbsd.org> @@ -60,9 +60,9 @@ bootstrap(int devfd, char *dev, char *bootfile) if (verbose) fprintf(stderr, "reading bootstrap from %s\n", bootfile); fd = open(bootfile, O_RDONLY); - if (fd < 0) + if (fd == -1) err(1, "open %s", bootfile); - if (fstat(fd, &sb) != 0) + if (fstat(fd, &sb) == -1) err(1, "fstat %s", bootfile); bootsec = howmany((ssize_t)sb.st_size, dl.d_secsize); bootsize = bootsec * dl.d_secsize; |
