8 static int recurse(const char *path, mode_t mode, int (*fn)(const char *,mode_t, int)) {
15 if (lstat (path, &st) == -1) {
18 if (strrchr(path, '/') != NULL) {
19 int n = strlen(path)-strlen(strrchr(path, '/'));
23 strncpy(dir, path, n);
31 int dlp_chmod(const char *path, mode_t mode, int recursive) {
32 #ifdef HAVE_WIN32_PROC
33 fprintf(stderr, "error: dlp_chmod not implemented on Win32 (%s)\n", path);
38 if (stat (path, &st) == -1)
41 if (chmod (path, mode) == -1) {
45 return recurse(path, mode, dlp_chmod);