xref: /third_party/musl/libc-test/src/regression/execle-env.c (revision 570af302)
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/musl/libc-test/src/regression/
1570af302Sopenharmony_ci// commit 2b2aff37aced66e4a50a38a14607a9b1dc0ee001 2013-10-03
2570af302Sopenharmony_ci// execle should pass env properly
3570af302Sopenharmony_ci#include <string.h>
4570af302Sopenharmony_ci#include <errno.h>
5570af302Sopenharmony_ci#include <unistd.h>
6570af302Sopenharmony_ci#include "test.h"
7570af302Sopenharmony_ci
8570af302Sopenharmony_ciint main(void)
9570af302Sopenharmony_ci{
10570af302Sopenharmony_ci	char *env[] = {"VAR=abc", 0};
11570af302Sopenharmony_ci
12570af302Sopenharmony_ci	execle("/bin/sh", "sh", "-c",
13570af302Sopenharmony_ci		"[ \"$VAR\" = abc ] || { echo '"__FILE__": env is not passed'; exit 1; }",
14570af302Sopenharmony_ci		(char*)0, env);
15570af302Sopenharmony_ci
16570af302Sopenharmony_ci	t_error("execle failed: %s\n", strerror(errno));
17570af302Sopenharmony_ci	return 1;
18570af302Sopenharmony_ci}
19

Indexes created Thu Nov 07 10:32:03 CST 2024