MCPcopy Create free account
hub / github.com/ioi/isolate / walktree

Function walktree

util.c:184–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182}
183
184static void
185walktree(struct walk_context *ctx, const char *path, void (*callback)(struct walk_context *ctx))
186{
187 ctx->callback = callback;
188 ctx->dir_fd = AT_FDCWD;
189 ctx->name = path;
190
191 struct walk_context top = *ctx;
192 top.dir_fd = open(path, O_RDONLY | O_DIRECTORY);
193 if (top.dir_fd < 0)
194 die("Cannot open directory %s: %m", path);
195
196 if (fstat(top.dir_fd, &ctx->st) < 0)
197 die("Cannot stat %s: %m", path);
198 assert(S_ISDIR(ctx->st.st_mode));
199 top.root_dev = ctx->st.st_dev;
200
201 walktree_ctx(&top);
202
203 ctx->is_dir = true;
204 ctx->callback(ctx);
205}
206
207static void
208rmtree_helper(struct walk_context *ctx)

Callers 2

rmtreeFunction · 0.85
chowntreeFunction · 0.85

Calls 1

walktree_ctxFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…