• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

NVIDIA / nvrc / 20321016685

17 Dec 2025 11:52PM UTC coverage: 34.332% (+0.5%) from 33.871%
20321016685

Pull #82

github

web-flow
Merge 3da25841a into 2f4720aec
Pull Request #82: Cleanup and refactor of daemon.rs

0 of 34 new or added lines in 3 files covered. (0.0%)

45 existing lines in 4 files now uncovered.

126 of 367 relevant lines covered (34.33%)

0.64 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/src/coreutils.rs
1
// SPDX-License-Identifier: Apache-2.0
2
// Copyright (c) NVIDIA CORPORATION
3

4
use anyhow::{Context, Result};
5
use nix::fcntl::AT_FDCWD;
6
use nix::sys::stat::{self, Mode, SFlag};
7
use nix::unistd::symlinkat;
8
use std::fs;
9
use std::path::Path;
10

11
/// Create (or update) a symbolic link from target to linkpath.
12
/// Idempotent: if link already points to target, it is left unchanged.
13
pub fn ln(target: &str, linkpath: &str) -> Result<()> {
2✔
14
    if let Ok(existing) = fs::read_link(linkpath) {
1✔
15
        if existing == Path::new(target) {
×
16
            return Ok(()); // already correct
×
17
        }
18
        // Existing link/file points elsewhere; remove it so we can replace
UNCOV
19
        let _ = fs::remove_file(linkpath);
×
20
    }
21
    symlinkat(target, AT_FDCWD, linkpath).with_context(|| format!("ln {} -> {}", linkpath, target))
1✔
22
}
23

24
/// Create (or replace) a character device node with desired major/minor.
25
/// Always recreates to avoid stale metadata/permissions.
26
pub fn mknod(path: &str, kind: SFlag, major: u64, minor: u64) -> Result<()> {
1✔
27
    if Path::new(path).exists() {
1✔
UNCOV
28
        fs::remove_file(path).with_context(|| format!("remove {} failed", path))?;
×
29
    }
30
    stat::mknod(
31
        path,
32
        kind,
33
        Mode::from_bits_truncate(0o666),
1✔
34
        stat::makedev(major, minor),
1✔
35
    )
36
    .with_context(|| format!("mknod {} failed", path))
1✔
37
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc