From cc89f57ccf970b47defd4f1f066110fbb6d20330 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Wed, 15 May 2002 19:45:38 +0000 Subject: Use access() instead of stat() to determine if the directory exists. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2228 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Preferences.cxx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx index 4c305ccd0..863e7602c 100644 --- a/src/Fl_Preferences.cxx +++ b/src/Fl_Preferences.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Preferences.cxx,v 1.1.2.10 2002/05/03 20:30:19 easysw Exp $" +// "$Id: Fl_Preferences.cxx,v 1.1.2.11 2002/05/15 19:45:38 easysw Exp $" // // Preferences methods for the Fast Light Tool Kit (FLTK). // @@ -580,12 +580,8 @@ Fl_Preferences::Name::~Name() int Fl_Preferences::Node::lastEntrySet = -1; // recursively create a path in the file system -static char makePath( const char *path ) -{ - struct stat stats; - int ret = stat( path, &stats ); - if ( ret ) - { +static char makePath( const char *path ) { + if (access(path, 0)) { const char *s = strrchr( path, '/' ); if ( !s ) return 0; int len = s-path; @@ -1084,5 +1080,5 @@ char Fl_Preferences::Node::remove() // -// End of "$Id: Fl_Preferences.cxx,v 1.1.2.10 2002/05/03 20:30:19 easysw Exp $". +// End of "$Id: Fl_Preferences.cxx,v 1.1.2.11 2002/05/15 19:45:38 easysw Exp $". // -- cgit v1.2.3