remove any dependency on stat.

This commit is contained in:
Enno Rehling 2014-03-15 20:41:58 -07:00
parent 1a4cb16ea8
commit 70cee3c6e5
2 changed files with 2 additions and 10 deletions

View File

@ -55,7 +55,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <quicklist.h> #include <quicklist.h>
/* libc includes */ /* libc includes */
#include <sys/stat.h>
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
#include <limits.h> #include <limits.h>
@ -1726,13 +1725,11 @@ static void write_script(FILE * F, const faction * f)
int init_reports(void) int init_reports(void)
{ {
prepare_reports(); prepare_reports();
#ifdef HAVE_STAT
{ {
stat_type st; if (_access(reportpath(), 0)!=0) {
if (stat(reportpath(), &st) == 0)
return 0; return 0;
} }
#endif }
if (_mkdir(reportpath()) != 0) { if (_mkdir(reportpath()) != 0) {
if (errno != EEXIST) { if (errno != EEXIST) {
perror("could not create reportpath"); perror("could not create reportpath");

View File

@ -96,11 +96,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <limits.h> #include <limits.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_STAT
#include <sys/types.h>
#include <sys/stat.h>
#endif
extern int verbosity; extern int verbosity;
extern int *storms; extern int *storms;
extern int weeks_per_month; extern int weeks_per_month;