Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core-dump-agent/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ async fn process_file(zip_path: &Path, bucket: &Bucket) {

let f = File::open(zip_path).expect("no file found");

match f.try_lock(FileLockMode::Shared) {
match AdvisoryFileLock::try_lock(&f, FileLockMode::Shared) {
Ok(_) => { /* If we can lock then we are ok */ }
Err(e) => {
let l_inotify = env::var("USE_INOTIFY")
Expand Down
2 changes: 1 addition & 1 deletion core-dump-composer/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl CoreEvent {
pub fn write_event(&self, eventlocation: &str) -> Result<(), anyhow::Error> {
let full_path = format!("{}/{}-event.json", eventlocation, self.uuid);
let file = File::create(full_path)?;
file.lock(FileLockMode::Exclusive)?;
AdvisoryFileLock::lock(&file, FileLockMode::Exclusive)?;
serde_json::to_writer(&file, &self)?;
file.unlock()?;
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion core-dump-composer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ fn handle(mut cc: config::CoreConfig) -> Result<(), anyhow::Error> {
process::exit(1);
}
};
file.lock(FileLockMode::Exclusive)?;
AdvisoryFileLock::lock(&file, FileLockMode::Exclusive)?;
let mut zip = ZipWriter::new(&file);

debug!(
Expand Down