mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 23:08:31 +00:00
parent
95f54eeb40
commit
c1d99676c4
1421 changed files with 5556 additions and 2198 deletions
|
@ -18,10 +18,8 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/calls/syscall-sysv.internal.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/log/bsd.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
|
@ -29,7 +27,7 @@
|
|||
|
||||
#define USAGE \
|
||||
"\
|
||||
usage: unveil.com [-h] PROG ARGS...\n\
|
||||
usage: pledge.com [-h] PROG ARGS...\n\
|
||||
-h show help\n\
|
||||
\n\
|
||||
unveil.com v1.o\n\
|
||||
|
@ -81,7 +79,7 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
bool chomped = false;
|
||||
while (!chomped)
|
||||
if (line[len - 1] == '\r' || line[len - 1] == '\n')
|
||||
if (line[len-1] == '\r' || line[len-1] == '\n')
|
||||
line[--len] = '\0';
|
||||
else
|
||||
chomped = true;
|
||||
|
@ -103,11 +101,11 @@ int main(int argc, char *argv[]) {
|
|||
err(1, "unveil(%s, %s)", fields[0], fields[1]);
|
||||
}
|
||||
free(line);
|
||||
if (ferror(stdin)) {
|
||||
if (ferror(stdin))
|
||||
err(1, "getline");
|
||||
}
|
||||
|
||||
if (unveil(NULL, NULL) == -1) err(1, "unveil(NULL, NULL)");
|
||||
if (unveil(NULL, NULL) == -1)
|
||||
err(1, "unveil(NULL, NULL)");
|
||||
|
||||
__sys_execve(prog, argv + optind, environ);
|
||||
err(127, "execve");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue