Get rid of the remaining FAILs
This commit is contained in:
		
							
								
								
									
										7
									
								
								common.c
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								common.c
									
									
									
									
									
								
							@@ -34,13 +34,6 @@
 | 
			
		||||
#include <arpa/inet.h>
 | 
			
		||||
#include <netinet/tcp.h>
 | 
			
		||||
 | 
			
		||||
/// Shorthand to set an error and return failure from the function
 | 
			
		||||
#define FAIL(...)                                                              \
 | 
			
		||||
	BLOCK_START                                                                \
 | 
			
		||||
		error_set (e, __VA_ARGS__);                                            \
 | 
			
		||||
		return 0;                                                              \
 | 
			
		||||
	BLOCK_END
 | 
			
		||||
 | 
			
		||||
// --- To be moved to liberty --------------------------------------------------
 | 
			
		||||
 | 
			
		||||
static ssize_t
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								zyklonb.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								zyklonb.c
									
									
									
									
									
								
							@@ -1028,11 +1028,17 @@ plugin_launch (struct bot_context *ctx, const char *name, struct error **e)
 | 
			
		||||
{
 | 
			
		||||
	const char *plugin_dir = str_map_find (&ctx->config, "plugin_dir");
 | 
			
		||||
	if (!plugin_dir)
 | 
			
		||||
		FAIL ("plugin directory not set");
 | 
			
		||||
	{
 | 
			
		||||
		error_set (e, "plugin directory not set");
 | 
			
		||||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	int stdin_pipe[2];
 | 
			
		||||
	if (pipe (stdin_pipe) == -1)
 | 
			
		||||
		FAIL ("%s: %s", "pipe", strerror (errno));
 | 
			
		||||
	{
 | 
			
		||||
		error_set (e, "%s: %s", "pipe", strerror (errno));
 | 
			
		||||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	int stdout_pipe[2];
 | 
			
		||||
	if (pipe (stdout_pipe) == -1)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user