aboutsummaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorEdwin Groothuis <edwin@FreeBSD.org>2002-12-12 09:39:12 +0000
committerEdwin Groothuis <edwin@FreeBSD.org>2002-12-12 09:39:12 +0000
commit88a77bccf93c996a8ca4abbb6240e7c33fc2b29c (patch)
treedbae63a1c295aa3a3e82d98a2e177f58129d2ac1 /games
parent2d657fa4205e27e78c19147b362a9c212c5c81f9 (diff)
downloadports-88a77bccf93c996a8ca4abbb6240e7c33fc2b29c.tar.gz
ports-88a77bccf93c996a8ca4abbb6240e7c33fc2b29c.zip
"The Options.cpp was trying to open a file that does not exist,
causing it to fail. we want to only try to open the file if it actually exists. PR: ports/45775 Submitted by: Frank J. Laszlo <laszlof@freebsdmatrix.net>
Notes
Notes: svn path=/head/; revision=71570
Diffstat (limited to 'games')
-rw-r--r--games/euchre/files/patch-src::lib::Options.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/games/euchre/files/patch-src::lib::Options.cpp b/games/euchre/files/patch-src::lib::Options.cpp
new file mode 100644
index 000000000000..4cc0e0f9b2fa
--- /dev/null
+++ b/games/euchre/files/patch-src::lib::Options.cpp
@@ -0,0 +1,33 @@
+--- src/lib/Options.cpp.orig Tue Nov 26 19:56:54 2002
++++ src/lib/Options.cpp Tue Nov 26 19:59:02 2002
+@@ -25,6 +25,9 @@
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <iostream.h>
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <unistd.h>
+
+ #include "Debug.hpp"
+ #include "Options.hpp"
+@@ -86,7 +89,19 @@
+ char fullpath[OPTIONS_PATH_SIZE];
+ snprintf(fullpath, OPTIONS_PATH_SIZE, "%s/%s", dir, OPTIONS_FILE_NAME);
+
+- ifstream in(fullpath, ios::nocreate);
++ // We only want to try to open the file if it already exists.
++ // ios::nocreate seems to have disappeared, so we'll use stat instead.
++
++ struct stat b;
++
++ if (-1 == stat(fullpath, &b))
++ {
++ LOG("could not open " << fullpath << endl);
++ return 1;
++ }
++
++ ifstream in(fullpath);
++
+ if (! in) {
+ LOG("could not open " << fullpath << endl);
+ return 1;