mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	module-pipe-sink: Fix usage of spa_strerror
spa_strerror() works with negative error codes and async spa results.
This commit is contained in:
		
							parent
							
								
									a168e4261f
								
							
						
					
					
						commit
						d5ee0ad8cc
					
				
					 1 changed files with 7 additions and 4 deletions
				
			
		| 
						 | 
					@ -265,7 +265,8 @@ struct module *create_module_pipe_sink(struct impl *impl, const char *argument)
 | 
				
			||||||
	do_unlink_fifo = false;
 | 
						do_unlink_fifo = false;
 | 
				
			||||||
	if (mkfifo(filename, 0666) < 0) {
 | 
						if (mkfifo(filename, 0666) < 0) {
 | 
				
			||||||
		if (errno != EEXIST) {
 | 
							if (errno != EEXIST) {
 | 
				
			||||||
			pw_log_error("mkfifo('%s'): %s", filename, spa_strerror(errno));
 | 
								res = -errno;
 | 
				
			||||||
 | 
								pw_log_error("mkfifo('%s'): %s", filename, spa_strerror(res));
 | 
				
			||||||
			goto out;
 | 
								goto out;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
| 
						 | 
					@ -275,16 +276,18 @@ struct module *create_module_pipe_sink(struct impl *impl, const char *argument)
 | 
				
			||||||
		 * requested permissions. Let's fix the permissions with chmod().
 | 
							 * requested permissions. Let's fix the permissions with chmod().
 | 
				
			||||||
		 */
 | 
							 */
 | 
				
			||||||
		if (chmod(filename, 0666) < 0)
 | 
							if (chmod(filename, 0666) < 0)
 | 
				
			||||||
			pw_log_warn("chmod('%s'): %s", filename, spa_strerror(errno));
 | 
								pw_log_warn("chmod('%s'): %s", filename, spa_strerror(-errno));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ((fd = open(filename, O_RDWR | O_CLOEXEC | O_NONBLOCK, 0)) <= 0) {
 | 
						if ((fd = open(filename, O_RDWR | O_CLOEXEC | O_NONBLOCK, 0)) <= 0) {
 | 
				
			||||||
        	pw_log_error("open('%s'): %s", filename, spa_strerror(errno));
 | 
							res = -errno;
 | 
				
			||||||
 | 
							pw_log_error("open('%s'): %s", filename, spa_strerror(res));
 | 
				
			||||||
		goto out;
 | 
							goto out;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (fstat(fd, &st) < 0) {
 | 
						if (fstat(fd, &st) < 0) {
 | 
				
			||||||
		pw_log_error("fstat('%s'): %s", filename, spa_strerror(errno));
 | 
							res = -errno;
 | 
				
			||||||
 | 
							pw_log_error("fstat('%s'): %s", filename, spa_strerror(res));
 | 
				
			||||||
		goto out;
 | 
							goto out;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue