Skip to content

Commit

Permalink
fix some errors
Browse files Browse the repository at this point in the history
Signed-off-by: nayuta-ai <[email protected]>
  • Loading branch information
nayuta-ai committed Nov 3, 2024
1 parent 8ec531f commit e95796f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/contest/runtimetest/src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::fs;
use std::fs::{metadata, symlink_metadata, OpenOptions};
use std::io::Read;
use std::os::unix::prelude::MetadataExt;
use std::path::PathBuf;
use std::process::Command;
use std::{fs, io};

use nix::sys::stat::{stat, SFlag};

Expand All @@ -14,8 +14,8 @@ fn test_file_read_access(path: &str) -> Result<bool, std::io::Error> {
let mut buffer = [0u8; 1];
match file.read(&mut buffer) {
// Our contest tests only use non-empty files for read-access
// tests. So if we get an EOF on the first read or zero bytes, the runtime did
// successfully block readability.
// tests. So if we get an EOF on the first read or zero bytes, the runtime did
// successfully block readability.
Ok(0) => Ok(false),
Ok(_) => Ok(true),
Err(e) if e.kind() == io::ErrorKind::UnexpectedEof => Ok(false),
Expand Down

0 comments on commit e95796f

Please sign in to comment.