1
0
mirror of https://gitlab.com/klmp200/fish.git synced 2024-11-22 00:33:20 +00:00
This commit is contained in:
Antoine Bartuccio 2017-06-11 02:42:33 +02:00
parent c0e130cb71
commit b7165df43f

View File

@ -15,12 +15,11 @@
pipe_redirection * getRedirection(){ pipe_redirection * getRedirection(){
static pipe_redirection * redirection = NULL; static pipe_redirection * redirection = NULL;
static char template[] = "/tmp/fishXXXXXX";
if (redirection == NULL){ if (redirection == NULL){
redirection = (pipe_redirection*) malloc(sizeof(pipe_redirection)); redirection = (pipe_redirection*) malloc(sizeof(pipe_redirection));
if (redirection == NULL) crash(); if (redirection == NULL) crash();
redirection->file_name = strdup((char*) template); redirection->file_name = strdup((char*) "/tmp/fishXXXXXX");
redirection->tmp_file = mkstemp(redirection->file_name); redirection->tmp_file = mkstemp(redirection->file_name);
redirection->to_use = 0; redirection->to_use = 0;
redirection->read = 0; redirection->read = 0;