1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00

replace open(path, 0) with open(path, O_RDONLY). amazing to still find

sloppiness like this.
This commit is contained in:
deraadt 2015-11-10 14:50:04 +00:00
parent b2246ea60f
commit 7f87976609

View File

@ -1,4 +1,4 @@
/* $OpenBSD: fortune.c,v 1.44 2015/10/24 18:02:28 mmcc Exp $ */
/* $OpenBSD: fortune.c,v 1.45 2015/11/10 14:50:04 deraadt Exp $ */
/* $NetBSD: fortune.c,v 1.8 1995/03/23 08:28:40 cgd Exp $ */
/*-
@ -408,7 +408,7 @@ add_file(int percent, char *file, char *dir, FILEDESC **head, FILEDESC **tail,
DPRINTF(1, (stderr, "adding file \"%s\"\n", path));
over:
if ((fd = open(path, 0)) < 0) {
if ((fd = open(path, O_RDONLY)) < 0) {
/*
* This is a sneak. If the user said -a, and if the
* file we're given isn't a file, we check to see if
@ -551,7 +551,7 @@ all_forts(FILEDESC *fp, char *offensive)
return;
if (!is_fortfile(offensive, &datfile, &posfile, 0))
return;
if ((fd = open(offensive, 0)) < 0)
if ((fd = open(offensive, O_RDONLY)) < 0)
return;
DPRINTF(1, (stderr, "adding \"%s\" because of -a\n", offensive));
scene = new_fp();
@ -993,7 +993,7 @@ get_tbl(FILEDESC *fp)
if (fp->read_tbl)
return;
if (fp->child == NULL) {
if ((fd = open(fp->datfile, 0)) < 0) {
if ((fd = open(fp->datfile, O_RDONLY)) < 0) {
perror(fp->datfile);
exit(1);
}