commit 33f9ea25c71c18df082c187e2ada3d3f288b912d from: Omar Polo via: Thomas Adam date: Sun Jul 24 14:41:52 2022 UTC tweak cmd_info; no functional changes intended * don't allocate unused pack_fds * drop wpath, cpath, proc, exec and sendfd pledge promises * close the worktree ok stsp@ commit - 95ad1e7d029b71d685721849684902a9e033e824 commit + 33f9ea25c71c18df082c187e2ada3d3f288b912d blob - 535760c6be3a2ad3aee954af2ae3c1f38620753a blob + 0d75dac8cda60fb9240db06ad390b363b234b780 --- got/got.c +++ got/got.c @@ -12988,7 +12988,6 @@ cmd_info(int argc, char *argv[]) struct got_pathlist_entry *pe; char *uuidstr = NULL; int ch, show_files = 0; - int *pack_fds = NULL; TAILQ_INIT(&paths); @@ -13014,10 +13013,6 @@ cmd_info(int argc, char *argv[]) goto done; } - error = got_repo_pack_fds_open(&pack_fds); - if (error != NULL) - goto done; - error = got_worktree_open(&worktree, cwd); if (error) { if (error->code == GOT_ERR_NOT_WORKTREE) @@ -13026,9 +13021,8 @@ cmd_info(int argc, char *argv[]) } #ifndef PROFILE - /* Remove "cpath" promise. */ - if (pledge("stdio rpath wpath flock proc exec sendfd unveil", - NULL) == -1) + /* Remove "wpath cpath proc exec sendfd" promises. */ + if (pledge("stdio rpath flock unveil", NULL) == -1) err(1, "pledge"); #endif error = apply_unveil(NULL, 0, got_worktree_get_root_path(worktree)); @@ -13085,12 +13079,8 @@ cmd_info(int argc, char *argv[]) } } done: - if (pack_fds) { - const struct got_error *pack_err = - got_repo_pack_fds_close(pack_fds); - if (error == NULL) - error = pack_err; - } + if (worktree) + got_worktree_close(worktree); TAILQ_FOREACH(pe, &paths, entry) free((char *)pe->path); got_pathlist_free(&paths);