mirror of
https://gitlab.com/klmp200/fish.git
synced 2024-11-22 00:33:20 +00:00
AH !
This commit is contained in:
parent
c0e130cb71
commit
b7165df43f
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user