Skip to content

Commit

Permalink
[refactor] Libwayshot instead of wayshot in shm
Browse files Browse the repository at this point in the history
Signed-off-by: Shinyzenith <[email protected]>
  • Loading branch information
Shinyzenith committed Jul 2, 2023
1 parent 004fdc5 commit fae9fe8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libwayshot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ fn create_shm_fd() -> std::io::Result<RawFd> {
loop {
// Create a file that closes on succesful execution and seal it's operations.
match memfd::memfd_create(
CStr::from_bytes_with_nul(b"wayshot\0").unwrap(),
CStr::from_bytes_with_nul(b"libwayshot\0").unwrap(),
memfd::MemFdCreateFlag::MFD_CLOEXEC | memfd::MemFdCreateFlag::MFD_ALLOW_SEALING,
) {
Ok(fd) => {
Expand All @@ -339,7 +339,7 @@ fn create_shm_fd() -> std::io::Result<RawFd> {
// Fallback to using shm_open.
let sys_time = SystemTime::now();
let mut mem_file_handle = format!(
"/wayshot-{}",
"/libwayshot-{}",
sys_time.duration_since(UNIX_EPOCH).unwrap().subsec_nanos()
);
loop {
Expand Down Expand Up @@ -367,7 +367,7 @@ fn create_shm_fd() -> std::io::Result<RawFd> {
Err(nix::errno::Errno::EEXIST) => {
// If a file with that handle exists then change the handle
mem_file_handle = format!(
"/wayshot-{}",
"/libwayshot-{}",
sys_time.duration_since(UNIX_EPOCH).unwrap().subsec_nanos()
);
continue;
Expand Down

0 comments on commit fae9fe8

Please sign in to comment.