*strrchr (copy, '/') = '\0';
if (copy[0])
{
- struct stat stat_buf;
- if ( ! (stat (copy, &stat_buf)==0 && S_ISDIR(stat_buf.st_mode)))
+ BablStat stat_buf;
+ if ( ! (_babl_stat (copy, &stat_buf)==0 && S_ISDIR(stat_buf.st_mode)))
{
if (mk_ancestry_iter (copy) != 0)
return -1;
#ifndef _WIN32
- return mkdir (copy, S_IRWXU);
+ return _babl_mkdir (copy, S_IRWXU);
#else
- return mkdir (copy);
+ return _babl_mkdir (copy);
#endif
}
}
static const char *
fish_cache_path (void)
{
- struct stat stat_buf;
+ BablStat stat_buf;
static char path[4096];
strncpy (path, FALLBACK_CACHE_PATH, 4096);
}
#endif
- if (stat (path, &stat_buf)==0 && S_ISREG(stat_buf.st_mode))
+ if (_babl_stat (path, &stat_buf)==0 && S_ISREG(stat_buf.st_mode))
return path;
if (mk_ancestry (path) != 0)
if (!tmpp)
return;
snprintf (tmpp, 8000, "%s~", fish_cache_path ());
- dbfile = fopen (tmpp, "w");
+ dbfile = _babl_fopen (tmpp, "w");
if (!dbfile)
{
free (tmpp);
fclose (dbfile);
#ifdef _WIN32
- remove (fish_cache_path ());
+ _babl_remove (fish_cache_path ());
#endif
- rename (tmpp, fish_cache_path());
+ _babl_rename (tmpp, fish_cache_path());
free (tmpp);
}