- FOR_EACH_DISK_STORAGE_COLUMN(i, t, cd) {
- struct stat statbuf;
- char *dirname = column_filename(t, i);
-
- ret = -ERRNO_TO_ERROR(ENOMEM);
- if (!dirname)
- goto err;
- /* check if directory exists */
- ret = stat(dirname, &statbuf);
- free(dirname);
- if (ret < 0) {
- ret = -ERRNO_TO_ERROR(errno);
- goto err;
- }
- ret = -ERRNO_TO_ERROR(ENOTDIR);
- if (!S_ISDIR(statbuf.st_mode))
- goto err;
- }