nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
model: add missing service to retrieve a AClassDef from a MClassDef.
[nit.git]
/
c_src
/
exec_nit.c
diff --git
a/c_src/exec_nit.c
b/c_src/exec_nit.c
index
242ed34
..
317e909
100644
(file)
--- a/
c_src/exec_nit.c
+++ b/
c_src/exec_nit.c
@@
-14,19
+14,33
@@
#include "exec_nit.h"
#include <stdlib.h>
#include <string.h>
#include "exec_nit.h"
#include <stdlib.h>
#include <string.h>
+#include <errno.h>
+#include <stdio.h>
-se_exec_data_t* exec_Process_Process_basic_exec_execute_4(int c, char *prog, char *args, int len, int pipeflag) {
+se_exec_data_t* exec_Process_Process_basic_exec_execute_4(void *s, char *prog, char *args, int len, int pipeflag) {
se_exec_data_t* result = NULL;
int id;
int in_fd[2];
int out_fd[2];
int err_fd[2];
se_exec_data_t* result = NULL;
int id;
int in_fd[2];
int out_fd[2];
int err_fd[2];
- if (pipeflag & 1)
- pipe(in_fd);
- if (pipeflag & 2)
- pipe(out_fd);
- if (pipeflag & 4)
- pipe(err_fd);
+ if (pipeflag & 1) {
+ int res = pipe(in_fd);
+ if ( res == -1 ) {
+ return NULL;
+ }
+ }
+ if (pipeflag & 2) {
+ int res = pipe(out_fd);
+ if ( res == -1 ) {
+ return NULL;
+ }
+ }
+ if (pipeflag & 4) {
+ int res = pipe(err_fd);
+ if ( res == -1 ) {
+ return NULL;
+ }
+ }
id = fork();
if (id == 0)
id = fork();
if (id == 0)
@@
-68,7
+82,7
@@
se_exec_data_t* exec_Process_Process_basic_exec_execute_4(int c, char *prog, cha
/* calls */
execvp(prog, arg);
/* calls */
execvp(prog, arg);
- abort();
+ _exit(127);
}
else if (id > 0)
{ /* father */
}
else if (id > 0)
{ /* father */
@@
-96,6
+110,7
@@
se_exec_data_t* exec_Process_Process_basic_exec_execute_4(int c, char *prog, cha
} else
result->err_fd = -1;
}
} else
result->err_fd = -1;
}
+
return result;
}
return result;
}