diff options
author | netblue30 <netblue30@yahoo.com> | 2020-03-22 08:54:16 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2020-03-22 08:54:16 -0400 |
commit | 3d35a3e623a8690aa7a32335f04da9d60b999872 (patch) | |
tree | b7157b4c5f854143b0a1964c3fd00c5441728a8c | |
parent | fixes (diff) | |
download | firejail-3d35a3e623a8690aa7a32335f04da9d60b999872.tar.gz firejail-3d35a3e623a8690aa7a32335f04da9d60b999872.tar.zst firejail-3d35a3e623a8690aa7a32335f04da9d60b999872.zip |
fix profstats to print warning for nonexistent include files
-rw-r--r-- | src/profstats/main.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/profstats/main.c b/src/profstats/main.c index 775142643..76b90f01b 100644 --- a/src/profstats/main.c +++ b/src/profstats/main.c | |||
@@ -48,6 +48,9 @@ static int arg_privatetmp = 0; | |||
48 | static int arg_whitelistvar = 0; | 48 | static int arg_whitelistvar = 0; |
49 | static int arg_ssh = 0; | 49 | static int arg_ssh = 0; |
50 | 50 | ||
51 | static char *profile = NULL; | ||
52 | |||
53 | |||
51 | static void usage(void) { | 54 | static void usage(void) { |
52 | printf("proftool - print profile statistics\n"); | 55 | printf("proftool - print profile statistics\n"); |
53 | printf("Usage: proftool [options] file[s]\n"); | 56 | printf("Usage: proftool [options] file[s]\n"); |
@@ -74,8 +77,9 @@ void process_file(const char *fname) { | |||
74 | 77 | ||
75 | FILE *fp = fopen(fname, "r"); | 78 | FILE *fp = fopen(fname, "r"); |
76 | if (!fp) { | 79 | if (!fp) { |
77 | fprintf(stderr, "Error: cannot open %s\n", fname); | 80 | fprintf(stderr, "Warning: cannot open %s, while processing %s\n", fname, profile); |
78 | exit(1); | 81 | level--; |
82 | return; | ||
79 | } | 83 | } |
80 | 84 | ||
81 | char buf[MAXBUF]; | 85 | char buf[MAXBUF]; |
@@ -187,6 +191,7 @@ int main(int argc, char **argv) { | |||
187 | int ssh = cnt_ssh; | 191 | int ssh = cnt_ssh; |
188 | 192 | ||
189 | // process file | 193 | // process file |
194 | profile = argv[i]; | ||
190 | process_file(argv[i]); | 195 | process_file(argv[i]); |
191 | 196 | ||
192 | // warnings | 197 | // warnings |