projects
/
libc-test
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1a301be
)
regression: execle test
author
Szabolcs Nagy
<nsz@port70.net>
Thu, 3 Oct 2013 15:46:55 +0000
(15:46 +0000)
committer
Szabolcs Nagy
<nsz@port70.net>
Thu, 3 Oct 2013 15:46:55 +0000
(15:46 +0000)
src/regression/execle-env.c
[new file with mode: 0644]
patch
|
blob
diff --git a/src/regression/execle-env.c
b/src/regression/execle-env.c
new file mode 100644
(file)
index 0000000..
d3a8b4e
--- /dev/null
+++ b/
src/regression/execle-env.c
@@ -0,0
+1,17
@@
+// execle should pass env properly
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+#include "test.h"
+
+int main(void)
+{
+ char *env[] = {"VAR=abc", 0};
+
+ execle("/bin/sh", "sh", "-c",
+ "[ \"$VAR\" = abc ] || { echo '"__FILE__": env is not passed'; exit 1; }",
+ (char*)0, env);
+
+ t_error("execle failed: %s\n", strerror(errno));
+ return 1;
+}