MCPcopy Create free account
hub / github.com/apache/httpd / dav_fs_add_locknull_state

Function dav_fs_add_locknull_state

modules/dav/fs/lock.c:925–952  ·  view source on GitHub ↗

### fold into append_lock? */ ### take an optional buf parameter? */

Source from the content-addressed store, hash-verified

923/* ### fold into append_lock? */
924/* ### take an optional buf parameter? */
925static dav_error * dav_fs_add_locknull_state(
926 dav_lockdb *lockdb,
927 const dav_resource *resource)
928{
929 dav_buffer buf = { 0 };
930 apr_pool_t *p = lockdb->info->pool;
931 const char *dirpath;
932 const char *fname;
933 dav_error *err;
934
935 /* ### should test this result value... */
936 (void) dav_fs_dir_file_name(resource, &dirpath, &fname);
937
938 if ((err = dav_fs_load_locknull_list(p, dirpath, &buf)) != NULL) {
939 return dav_push_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
940 "Could not load .locknull file.", err);
941 }
942
943 dav_buffer_append(p, &buf, fname);
944 buf.cur_len++; /* we want the null-term here */
945
946 if ((err = dav_fs_save_locknull_list(p, dirpath, &buf)) != NULL) {
947 return dav_push_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
948 "Could not save .locknull file.", err);
949 }
950
951 return NULL;
952}
953
954/*
955** dav_fs_remove_locknull_state: Given a request, check to see if r->filename

Callers 1

dav_fs_append_locksFunction · 0.85

Calls 5

dav_fs_dir_file_nameFunction · 0.85
dav_push_errorFunction · 0.85
dav_buffer_appendFunction · 0.85

Tested by

no test coverage detected