static char *mtime_as_string(struct augeas *aug, const char *fname) {
    int r;
    struct stat st;
    char *result = NULL;

    if (fname == NULL) {
        result = strdup("0");
        ERR_NOMEM(result == NULL, aug);
        goto done;
    }

    r = stat(fname, &st);
    if (r < 0) {
        /* If we fail to stat, silently ignore the error
         * and report an impossible mtime */
        result = strdup("0");
        ERR_NOMEM(result == NULL, aug);
    } else {
        r = xasprintf(&result, "%ld", (long) st.st_mtime);
        ERR_NOMEM(r < 0, aug);
    }
 done:
    return result;
 error:
    FREE(result);
    return NULL;
}
static char *mtime_as_string(struct augeas *aug, const char *fname) {
    int r;
    struct stat st;
    char *result = NULL;

    if (fname == NULL) {
        result = strdup("0");
        ERR_NOMEM(result == NULL, aug);
        goto done;
    }

    r = stat(fname, &st);
    if (r < 0) {
         
        result = strdup("0");
        ERR_NOMEM(result == NULL, aug);
    } else {
        r = xasprintf(&result, "%ld", (long) st.st_mtime);
        ERR_NOMEM(r < 0, aug);
    }
 done:
    return result;
 error:
    FREE(result);
    return NULL;
}