commit 10a16316a03005a07c45b2bbf1b5644b64e846fb from: Omar Polo date: Sun Jul 24 13:59:11 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 - 1004841d7c8045b627768a441ebdb9c824d2134d commit + 10a16316a03005a07c45b2bbf1b5644b64e846fb blob - 8546c7cf32d663cd5a666d40d2f858885cac2483 blob + 426fe05030db9048691647f7a8580d916d95ab60 --- 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);