PIPESINGLE macro was wrong

This commit is contained in:
Jack Halford 2017-02-19 15:18:46 +01:00
parent c65e07038b
commit 694744bf0c
2 changed files with 4 additions and 1 deletions

View file

@ -33,7 +33,7 @@
# define IS_PIPESTART(a) (a & PROCESS_PIPESTART) # define IS_PIPESTART(a) (a & PROCESS_PIPESTART)
# define IS_PIPEEND(a) (a & PROCESS_PIPEEND) # define IS_PIPEEND(a) (a & PROCESS_PIPEEND)
# define IS_PIPESINGLE(a) (a & (PROCESS_PIPESTART | PROCESS_PIPEEND)) # define IS_PIPESINGLE(a) ((a & PROCESS_PIPESTART) && (a & PROCESS_PIPEEND))
# include "libft.h" # include "libft.h"
# include "types.h" # include "types.h"

View file

@ -18,6 +18,7 @@ int launch_process(t_process *p)
int pid; int pid;
exec = &data_singleton()->exec; exec = &data_singleton()->exec;
DG("launching");
if (p->attributes & PROCESS_UNKNOWN) if (p->attributes & PROCESS_UNKNOWN)
{ {
ft_dprintf(2, "{red}%s: command not found: %s{eoc}\n", SHELL_NAME, p->av[0]); ft_dprintf(2, "{red}%s: command not found: %s{eoc}\n", SHELL_NAME, p->av[0]);
@ -25,6 +26,7 @@ int launch_process(t_process *p)
} }
else if (p->attributes & PROCESS_BUILTIN && IS_PIPESINGLE(p->attributes)) else if (p->attributes & PROCESS_BUILTIN && IS_PIPESINGLE(p->attributes))
{ {
DG("check 0");
if (process_redirect(p)) if (process_redirect(p))
return (1); return (1);
set_exitstatus((*p->execf)(p->path, p->av, data_singleton()->env), 1); set_exitstatus((*p->execf)(p->path, p->av, data_singleton()->env), 1);
@ -40,6 +42,7 @@ int launch_process(t_process *p)
set_exitstatus(126, 1); set_exitstatus(126, 1);
return (1); return (1);
} }
DG("gonna fork now");
pid = fork(); pid = fork();
if (pid == 0) if (pid == 0)
{ {