Index: trunk/config.h.in =================================================================== --- trunk/config.h.in (revision 23109) +++ trunk/config.h.in (revision 23110) @@ -273,6 +273,7 @@ # define system never_use_system__use_pcb_system # define remove never_use_remove__use_pcb_remove # define rename never_use_rename__use_pcb_rename +# define mkdir never_use_mkdir__use_pcb_mkdir # endif #endif Index: trunk/src/compat_fs.c =================================================================== --- trunk/src/compat_fs.c (revision 23109) +++ trunk/src/compat_fs.c (revision 23110) @@ -29,6 +29,7 @@ /* misc functions used by several modules */ +#define PCB_SAFE_FS #include "config.h" #include "compat_inc.h" @@ -74,7 +75,7 @@ #else # error no mkdir() available #endif -int pcb_mkdir(const char *path, int mode) +int pcb_mkdir_(const char *path, int mode) { #if MKDIR_NUM_ARGS == 1 return MKDIR(path); Index: trunk/src/compat_fs.h =================================================================== --- trunk/src/compat_fs.h (revision 23109) +++ trunk/src/compat_fs.h (revision 23110) @@ -2,8 +2,6 @@ the current working directory is copied to the array pointed to by 'path' */ char *pcb_get_wd(char *path); -int pcb_mkdir(const char *path, int mode); - /* alternative to system() for proper argument passing */ int pcb_spawnvp(const char **argv); Index: trunk/src/safe_fs.c =================================================================== --- trunk/src/safe_fs.c (revision 23109) +++ trunk/src/safe_fs.c (revision 23110) @@ -290,3 +290,13 @@ return NULL; } +extern int pcb_mkdir_(const char *path, int mode); +int pcb_mkdir(const char *path, int mode) +{ + CHECK("mkdir", "access", path, NULL, return -1); + CHECK("mkdir", "mkdir", path, NULL, return -1); + + return pcb_mkdir_(path, mode); +} + + Index: trunk/src/safe_fs.h =================================================================== --- trunk/src/safe_fs.h (revision 23109) +++ trunk/src/safe_fs.h (revision 23110) @@ -39,6 +39,7 @@ int pcb_system(const char *cmd); int pcb_remove(const char *path); int pcb_rename(const char *old_path, const char *new_path); +int pcb_mkdir(const char *path, int mode); /* Check if path could be open with mode; if yes, return the substituted/expanded file name, if no, return NULL */ Index: trunk/src_plugins/cam/cam.c =================================================================== --- trunk/src_plugins/cam/cam.c (revision 23109) +++ trunk/src_plugins/cam/cam.c (revision 23110) @@ -39,7 +39,7 @@ #include "actions.h" #include "cam_conf.h" #include "compat_misc.h" -#include "compat_fs.h" +#include "safe_fs.h" #include "../src_plugins/cam/conf_internal.c"