Skip to content

Commit

Permalink
--fbuilder cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
netblue30 committed Apr 28, 2024
1 parent 54d9fd0 commit 4ad124a
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/fbuilder/build_bin.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static void process_bin(const char *fname) {
// process trace file
FILE *fp = fopen(fname, "r");
if (!fp) {
fprintf(stderr, "Error: cannot open %s\n", fname);
fprintf(stderr, "Error fbuilder: cannot open %s\n", fname);
exit(1);
}

Expand Down
2 changes: 1 addition & 1 deletion src/fbuilder/build_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ static void process_file(const char *fname, const char *dir, void (*callback)(ch
// process trace file
FILE *fp = fopen(fname, "r");
if (!fp) {
fprintf(stderr, "Error: cannot open %s\n", fname);
fprintf(stderr, "Error fbuilder: cannot open %s\n", fname);
exit(1);
}

Expand Down
2 changes: 1 addition & 1 deletion src/fbuilder/build_home.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void process_home(const char *fname, char *home, int home_len) {
// process trace file
FILE *fp = fopen(fname, "r");
if (!fp) {
fprintf(stderr, "Error: cannot open %s\n", fname);
fprintf(stderr, "Error fbuilder: cannot open %s\n", fname);
exit(1);
}

Expand Down
4 changes: 2 additions & 2 deletions src/fbuilder/build_profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
void build_profile(int argc, char **argv, int index, FILE *fp) {
// next index is the application name
if (index >= argc) {
fprintf(stderr, "Error: application name missing\n");
fprintf(stderr, "Error fbuilder: application name missing\n");
exit(1);
}

Expand Down Expand Up @@ -165,7 +165,7 @@ void build_profile(int argc, char **argv, int index, FILE *fp) {
unlink(trace_output);
}
else {
fprintf(stderr, "Error: cannot run the sandbox\n");
fprintf(stderr, "Error fbuilder: cannot run the sandbox\n");
exit(1);
}
}
6 changes: 3 additions & 3 deletions src/fbuilder/build_seccomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void build_seccomp(const char *fname, FILE *fp) {

FILE *fp2 = fopen(fname, "r");
if (!fp2) {
fprintf(stderr, "Error: cannot open %s\n", fname);
fprintf(stderr, "Error fbuilder: cannot open %s\n", fname);
exit(1);
}

Expand All @@ -54,7 +54,7 @@ void build_seccomp(const char *fname, FILE *fp) {
}
else if (line == 2) {
if (*buf != '-') {
fprintf(stderr, "Error: invalid strace output\n%s\n", buf);
fprintf(stderr, "Error fbuilder: invalid strace output\n%s\n", buf);
exit(1);
}
}
Expand Down Expand Up @@ -96,7 +96,7 @@ static void process_protocol(const char *fname) {
// process trace file
FILE *fp = fopen(fname, "r");
if (!fp) {
fprintf(stderr, "Error: cannot open %s\n", fname);
fprintf(stderr, "Error fbuilder: cannot open %s\n", fname);
exit(1);
}

Expand Down
2 changes: 1 addition & 1 deletion src/fbuilder/filedb.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ FileDB *filedb_load_whitelist(FileDB *head, const char *fname, const char *prefi
errExit("asprintf");
FILE *fp = fopen(f, "r");
if (!fp) {
fprintf(stderr, "Error: cannot open %s\n", f);
fprintf(stderr, "Error fbuilder: cannot open %s\n", f);
free(f);
exit(1);
}
Expand Down
8 changes: 4 additions & 4 deletions src/fbuilder/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,21 @@ printf("\n");

// don't run if the file exists
if (access(argv[i] + 8, F_OK) == 0) {
fprintf(stderr, "Error: the profile file already exists. Please use a different file name.\n");
fprintf(stderr, "Error fbuilder: the profile file already exists. Please use a different file name.\n");
exit(1);
}

// check file access
fp = fopen(argv[i] + 8, "w");
if (!fp) {
fprintf(stderr, "Error: cannot open profile file.\n");
fprintf(stderr, "Error fbuilder: cannot open profile file.\n");
exit(1);
}
prof_file = argv[i] + 8;
}
else {
if (*argv[i] == '-') {
fprintf(stderr, "Error: invalid program\n");
fprintf(stderr, "Error fbuilder: invalid program\n");
usage();
exit(1);
}
Expand All @@ -90,7 +90,7 @@ printf("\n");
}

if (prog_index == 0) {
fprintf(stderr, "Error : program and arguments required\n");
fprintf(stderr, "Error fbuilder: program and arguments required\n");
usage();
if (prof_file) {
fclose(fp);
Expand Down

0 comments on commit 4ad124a

Please sign in to comment.