Example #1
0
/* frees resources allocated in call to parse_path_args() */
void DCOPY_free_path_args(void)
{
    /* free memory associated with destination path */
    mfu_param_path_free(&dest_param);

    /* free memory associated with source paths */
    int i;
    for(i = 0; i < num_src_params; i++) {
        mfu_param_path_free(&src_params[i]);
    }
    num_src_params = 0;
    mfu_free(&src_params);
}
Example #2
0
/* look up mtimes for specified file,
 * return secs/nsecs in newly allocated mfu_pred_times struct,
 * return NULL on error */
static mfu_pred_times* get_mtimes(const char* file)
{
    mfu_param_path param_path;
    mfu_param_path_set(file, &param_path);
    if (! param_path.path_stat_valid) {
        return NULL;
    }
    mfu_pred_times* t = (mfu_pred_times*) MFU_MALLOC(sizeof(mfu_pred_times));
    mfu_stat_get_mtimes(&param_path.path_stat, &t->secs, &t->nsecs);
    mfu_param_path_free(&param_path);
    return t;
}