rectif du fork git prompt
This commit is contained in:
parent
c2952d577c
commit
4a22ddc0e1
1 changed files with 4 additions and 3 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
|
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2016/12/13 13:51:33 by gwojda #+# #+# */
|
/* Created: 2016/12/13 13:51:33 by gwojda #+# #+# */
|
||||||
/* Updated: 2017/03/08 20:57:05 by jhalford ### ########.fr */
|
/* Updated: 2017/03/08 21:23:54 by wescande ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -20,12 +20,13 @@ static int ft_git_status(void)
|
||||||
char *line;
|
char *line;
|
||||||
pid_t soon;
|
pid_t soon;
|
||||||
char *exec[] = {"git", "status", "--porcelain", "--branch", NULL};
|
char *exec[] = {"git", "status", "--porcelain", "--branch", NULL};
|
||||||
|
int ret;
|
||||||
|
|
||||||
pipe(pip);
|
pipe(pip);
|
||||||
if ((soon = fork()))
|
if ((soon = fork()))
|
||||||
{
|
{
|
||||||
wait(&soon);
|
waitpid(soon, &ret, WUNTRACED);
|
||||||
if (WEXITSTATUS(soon))
|
if (WEXITSTATUS(ret))
|
||||||
return (-1);
|
return (-1);
|
||||||
close(pip[1]);
|
close(pip[1]);
|
||||||
get_next_line(pip[0], &line);
|
get_next_line(pip[0], &line);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue