summaryrefslogtreecommitdiffstats
path: root/src/e_pipes.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-10-27 19:59:20 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-10-27 19:59:20 +0100
commitc5aae008dee36276154882d8fd56c3bdeb473474 (patch)
treea40740914847ebf39a5f8cb3acf6a48c8b9d61ef /src/e_pipes.c
parentTODO update (diff)
download42-minishell-c5aae008dee36276154882d8fd56c3bdeb473474.tar.gz
42-minishell-c5aae008dee36276154882d8fd56c3bdeb473474.tar.bz2
42-minishell-c5aae008dee36276154882d8fd56c3bdeb473474.tar.xz
42-minishell-c5aae008dee36276154882d8fd56c3bdeb473474.tar.zst
42-minishell-c5aae008dee36276154882d8fd56c3bdeb473474.zip
Now norme
Diffstat (limited to '')
-rw-r--r--src/e_pipes.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/e_pipes.c b/src/e_pipes.c
index 9ab08ba..4ad9e46 100644
--- a/src/e_pipes.c
+++ b/src/e_pipes.c
@@ -13,7 +13,6 @@
#include <sys/wait.h>
#include <libft.h>
#include <stdlib.h>
-#include <stdint.h>
#ifdef __linux__
# include <linux/limits.h>
#else
@@ -29,11 +28,11 @@
#include "u_utils.h"
#include "u_path.h"
-static uint8_t e_get_current_path(char fullpath[],
+static unsigned char e_get_current_path(char fullpath[],
struct s_lpipes *ptr,
t_msh *msh)
{
- uint8_t fp_ret;
+ unsigned char fp_ret;
fp_ret = 0;
if (ptr->com->bin != NULL && ft_ischarset("/.", ptr->com->bin[0]) == TRUE)
@@ -58,15 +57,15 @@ static uint8_t e_get_current_path(char fullpath[],
** TODO: handle fork() failed, etc
*/
-static int32_t e_unroll_pipes(int32_t fd[256][2],
+static int e_unroll_pipes(int fd[256][2],
size_t pipes,
t_msh *msh)
{
struct s_lpipes *head;
char fullpath[PATH_MAX];
- int32_t pid;
- uint16_t i;
- uint8_t fp_ret;
+ int pid;
+ unsigned short i;
+ unsigned char fp_ret;
head = msh->pipes;
i = 0;
@@ -94,10 +93,10 @@ static int32_t e_unroll_pipes(int32_t fd[256][2],
static void e_pipe_exec(size_t pipes, t_msh *msh)
{
- int32_t fd[256][2];
- int32_t pid;
- int32_t status;
- uint16_t i;
+ int fd[256][2];
+ int pid;
+ int status;
+ unsigned short i;
i = 0;
while (i < pipes && i < 255)