Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-bonez committed Sep 26, 2024
1 parent 93156dc commit 642b95e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
18 changes: 11 additions & 7 deletions core/startos/src/disk/mount/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ use tracing::instrument;
use crate::util::Invoke;
use crate::Error;

pub async fn is_mountpoint(path: impl AsRef<Path>) -> Result<bool, Error> {
let is_mountpoint = tokio::process::Command::new("mountpoint")
.arg(path.as_ref())
.stdout(std::process::Stdio::null())
.stderr(std::process::Stdio::null())
.status()
.await?;
Ok(is_mountpoint.success())
}

#[instrument(skip_all)]
pub async fn bind<P0: AsRef<Path>, P1: AsRef<Path>>(
src: P0,
Expand All @@ -16,13 +26,7 @@ pub async fn bind<P0: AsRef<Path>, P1: AsRef<Path>>(
src.as_ref().display(),
dst.as_ref().display()
);
let is_mountpoint = tokio::process::Command::new("mountpoint")
.arg(dst.as_ref())
.stdout(std::process::Stdio::null())
.stderr(std::process::Stdio::null())
.status()
.await?;
if is_mountpoint.success() {
if is_mountpoint(&dst).await? {
unmount(dst.as_ref(), true).await?;
}
tokio::fs::create_dir_all(&src).await?;
Expand Down
3 changes: 2 additions & 1 deletion core/startos/src/lxc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ impl LxcManager {
Path::new(LXC_CONTAINER_DIR).join(container).join("rootfs"),
true,
)
.await?;
.await
.log_err();
if tokio_stream::wrappers::ReadDirStream::new(
tokio::fs::read_dir(&rootfs_path).await?,
)
Expand Down
2 changes: 1 addition & 1 deletion sdk/package/lib/test/makeOutput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ oldSpecToBuilder(
default: true,
},
avoidpartialspends: {
name: "avoid Partial Spends",
name: "Avoid Partial Spends",
description:
"Group outputs by address, selecting all or none, instead of selecting on a per-output basis. This improves privacy at the expense of higher transaction fees.",
type: "boolean",
Expand Down
2 changes: 1 addition & 1 deletion sdk/package/lib/version/VersionGraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class VersionGraph<CurrentVersion extends string> {
VersionInfo<any>,
Vertex<
ExtendedVersion | VersionRange,
(opts: { effects: T.Effects }) => Promise<null>
(opts: { effects: T.Effects }) => Promise<void>
>,
]
| undefined = undefined
Expand Down

0 comments on commit 642b95e

Please sign in to comment.