| 685 | } |
| 686 | |
| 687 | static apr_status_t pfs_remove(void *baton, apr_pool_t *p, apr_pool_t *ptemp, va_list ap) |
| 688 | { |
| 689 | md_store_fs_t *s_fs = baton; |
| 690 | const char *dir, *name, *fpath, *groupname, *aspect; |
| 691 | apr_status_t rv; |
| 692 | int force; |
| 693 | apr_finfo_t info; |
| 694 | md_store_group_t group; |
| 695 | |
| 696 | (void)p; |
| 697 | group = (md_store_group_t)va_arg(ap, int); |
| 698 | name = va_arg(ap, const char*); |
| 699 | aspect = va_arg(ap, const char *); |
| 700 | force = va_arg(ap, int); |
| 701 | |
| 702 | groupname = md_store_group_name(group); |
| 703 | |
| 704 | if ( MD_OK(md_util_path_merge(&dir, ptemp, s_fs->base, groupname, name, NULL)) |
| 705 | && MD_OK(md_util_path_merge(&fpath, ptemp, dir, aspect, NULL))) { |
| 706 | md_log_perror(MD_LOG_MARK, MD_LOG_TRACE1, 0, ptemp, "start remove of md %s/%s/%s", |
| 707 | groupname, name, aspect); |
| 708 | |
| 709 | if (!MD_OK(apr_stat(&info, dir, APR_FINFO_TYPE, ptemp))) { |
| 710 | if (APR_ENOENT == rv && force) { |
| 711 | return APR_SUCCESS; |
| 712 | } |
| 713 | return rv; |
| 714 | } |
| 715 | |
| 716 | rv = apr_file_remove(fpath, ptemp); |
| 717 | if (APR_ENOENT == rv && force) { |
| 718 | rv = APR_SUCCESS; |
| 719 | } |
| 720 | } |
| 721 | return rv; |
| 722 | } |
| 723 | |
| 724 | static apr_status_t fs_load(md_store_t *store, md_store_group_t group, |
| 725 | const char *name, const char *aspect, |
nothing calls this directly
no test coverage detected