mirror of
				https://github.com/rad4day/Waybar.git
				synced 2025-11-04 09:42:42 +01:00 
			
		
		
		
	explicitly checking for errors to silence unused variable warnings when writing to fd
This commit is contained in:
		@@ -14,12 +14,16 @@ Ipc::~Ipc() {
 | 
			
		||||
 | 
			
		||||
  if (fd_ > 0) {
 | 
			
		||||
    // To fail the IPC header
 | 
			
		||||
    write(fd_, "close-sway-ipc", 14);
 | 
			
		||||
    if (write(fd_, "close-sway-ipc", 14) == -1) {
 | 
			
		||||
       std::runtime_error("Couldn't close Sway IPC through fd");
 | 
			
		||||
    }
 | 
			
		||||
    close(fd_);
 | 
			
		||||
    fd_ = -1;
 | 
			
		||||
  }
 | 
			
		||||
  if (fd_event_ > 0) {
 | 
			
		||||
    write(fd_event_, "close-sway-ipc", 14);
 | 
			
		||||
    if (write(fd_event_, "close-sway-ipc", 14) == -1) {
 | 
			
		||||
        std::runtime_error("Couldn't close Sway IPC through fd_event");
 | 
			
		||||
    }
 | 
			
		||||
    close(fd_event_);
 | 
			
		||||
    fd_event_ = -1;
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user