浏览代码

Fix broken exec test

jD91mZM2 6 年之前
父节点
当前提交
86a38b47d1
共有 3 个文件被更改,包括 3 次插入3 次删除
  1. 0 1
      tests/expected/unistd/exec.stderr
  2. 1 0
      tests/expected/unistd/exec.stdout
  3. 2 2
      tests/unistd/exec.c

+ 0 - 1
tests/expected/unistd/exec.stderr

@@ -1 +0,0 @@
-execv: No such file or directory

+ 1 - 0
tests/expected/unistd/exec.stdout

@@ -0,0 +1 @@
+exec works :D

+ 2 - 2
tests/unistd/exec.c

@@ -2,8 +2,8 @@
 #include <stdio.h>
 
 int main(int argc, char** argv) {
-    char *const args[1] = {"arg"};
-    execv("write", args);
+    char* args[] = {"sh", "-c", "echo 'exec works :D'", NULL};
+    execv("/bin/sh", args);
     perror("execv");
     return 0;
 }