diff options
author | 2001-10-30 16:47:32 +0000 | |
---|---|---|
committer | 2001-10-30 16:47:32 +0000 | |
commit | c1b2f8d866fe17fe4e0627d27ef3e91aac67c242 (patch) | |
tree | 34383eadbf493295a73ba81ee013c15ce65d4e5f | |
parent | ddp_print needs aligned data (alpha,sparc). Noted (with a patch) by <jepeway@blasted-heath.com>. Patch code relocated inside ddp_print(). Fixes PR# 1945. (diff) | |
download | wireguard-openbsd-c1b2f8d866fe17fe4e0627d27ef3e91aac67c242.tar.xz wireguard-openbsd-c1b2f8d866fe17fe4e0627d27ef3e91aac67c242.zip |
correct open() checks
-rw-r--r-- | gnu/usr.bin/ld/ld.c | 4 | ||||
-rw-r--r-- | gnu/usr.bin/ld/lib.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/gnu/usr.bin/ld/ld.c b/gnu/usr.bin/ld/ld.c index 7856a21893a..9fb3f621eaa 100644 --- a/gnu/usr.bin/ld/ld.c +++ b/gnu/usr.bin/ld/ld.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ld.c,v 1.18 2001/07/08 17:49:44 espie Exp $ */ +/* $OpenBSD: ld.c,v 1.19 2001/10/30 16:47:32 deraadt Exp $ */ /* $NetBSD: ld.c,v 1.52 1998/02/20 03:12:51 jonathan Exp $ */ /*- @@ -1039,7 +1039,7 @@ file_open(entry) } else fd = open(entry->filename, O_RDONLY, 0); - if (fd > 0) { + if (fd >= 0) { input_file = entry; input_desc = fd; return fd; diff --git a/gnu/usr.bin/ld/lib.c b/gnu/usr.bin/ld/lib.c index 6a57d7b511b..01967ab7edf 100644 --- a/gnu/usr.bin/ld/lib.c +++ b/gnu/usr.bin/ld/lib.c @@ -1,4 +1,4 @@ -/* * $OpenBSD: lib.c,v 1.3 2001/08/30 10:42:01 espie Exp $ - library routines*/ +/* * $OpenBSD: lib.c,v 1.4 2001/10/30 16:47:32 deraadt Exp $ - library routines*/ /* */ @@ -817,7 +817,7 @@ struct file_entry *p; fname = findshlib(p->filename, &major, &minor, 1); - if (fname && (fd = open(fname, O_RDONLY, 0)) > 0) { + if (fname && (fd = open(fname, O_RDONLY, 0)) >= 0) { p->filename = fname; p->lib_major = major; p->lib_minor = minor; @@ -839,7 +839,7 @@ dot_a: register char *path = concat(search_dirs[i], "/", fname); fd = open(path, O_RDONLY, 0); - if (fd > 0) { + if (fd >= 0) { p->filename = path; p->flags &= ~E_SEARCH_DIRS; break; |