aboutsummaryrefslogtreecommitdiffstats
path: root/src/tools/extract_syscalls.c
diff options
context:
space:
mode:
authorLibravatar Fred Barclay <Fred-Barclay@users.noreply.github.com>2017-05-24 14:13:52 -0500
committerLibravatar Fred Barclay <Fred-Barclay@users.noreply.github.com>2017-05-24 14:13:52 -0500
commit96c920e166b40bbe50f216e294f2efac154a1cb2 (patch)
treefa80a34e81863ab897f2f2b8ec4124b10d023516 /src/tools/extract_syscalls.c
parentremove trailing whitespace from etc/ (diff)
downloadfirejail-96c920e166b40bbe50f216e294f2efac154a1cb2.tar.gz
firejail-96c920e166b40bbe50f216e294f2efac154a1cb2.tar.zst
firejail-96c920e166b40bbe50f216e294f2efac154a1cb2.zip
Remove trailing whitespace from src/
Diffstat (limited to 'src/tools/extract_syscalls.c')
-rw-r--r--src/tools/extract_syscalls.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/tools/extract_syscalls.c b/src/tools/extract_syscalls.c
index 9af24b8cd..4dad0d2b6 100644
--- a/src/tools/extract_syscalls.c
+++ b/src/tools/extract_syscalls.c
@@ -28,14 +28,14 @@ int main(int argc, char **argv) {
28 printf("usage: %s /usr/include/x86_64-linux-gnu/bits/syscall.h\n", argv[0]); 28 printf("usage: %s /usr/include/x86_64-linux-gnu/bits/syscall.h\n", argv[0]);
29 return 1; 29 return 1;
30 } 30 }
31 31
32 //open file 32 //open file
33 FILE *fp = fopen(argv[1], "r"); 33 FILE *fp = fopen(argv[1], "r");
34 if (!fp) { 34 if (!fp) {
35 fprintf(stderr, "Error: cannot open file\n"); 35 fprintf(stderr, "Error: cannot open file\n");
36 return 1; 36 return 1;
37 } 37 }
38 38
39 // read file 39 // read file
40 char buf[BUFMAX]; 40 char buf[BUFMAX];
41 while (fgets(buf, BUFMAX, fp)) { 41 while (fgets(buf, BUFMAX, fp)) {
@@ -46,7 +46,7 @@ int main(int argc, char **argv) {
46 char *end = strchr(start, '\n'); 46 char *end = strchr(start, '\n');
47 if (end) 47 if (end)
48 *end = '\0'; 48 *end = '\0';
49 49
50 // parsing 50 // parsing
51 if (strncmp(start, "# error", 7) == 0) 51 if (strncmp(start, "# error", 7) == 0)
52 continue; 52 continue;
@@ -66,7 +66,7 @@ int main(int argc, char **argv) {
66 return 1; 66 return 1;
67 } 67 }
68 *(ptr2 - 1) = '\0'; 68 *(ptr2 - 1) = '\0';
69 69
70 char *ptr3 = ptr1; 70 char *ptr3 = ptr1;
71 while (*ptr3 != ' ' && *ptr3 != '\t' && *ptr3 != '\0') 71 while (*ptr3 != ' ' && *ptr3 != '\t' && *ptr3 != '\0')
72 ptr3++; 72 ptr3++;
@@ -75,17 +75,17 @@ int main(int argc, char **argv) {
75 while (*ptr3 != ' ' && *ptr3 != '\t' && *ptr3 != '\0') 75 while (*ptr3 != ' ' && *ptr3 != '\t' && *ptr3 != '\0')
76 ptr3++; 76 ptr3++;
77 *ptr3 = '\0'; 77 *ptr3 = '\0';
78 78
79 ptr3 = ptr1; 79 ptr3 = ptr1;
80 while (*ptr3 != '_') 80 while (*ptr3 != '_')
81 ptr3++; 81 ptr3++;
82 ptr3++; 82 ptr3++;
83 83
84 printf("#ifdef %s\n", ptr1); 84 printf("#ifdef %s\n", ptr1);
85 printf("#ifdef %s\n", ptr2); 85 printf("#ifdef %s\n", ptr2);
86 printf("\t{\"%s\", %s},\n", ptr3, ptr2); 86 printf("\t{\"%s\", %s},\n", ptr3, ptr2);
87 printf("#endif\n"); 87 printf("#endif\n");
88 printf("#endif\n"); 88 printf("#endif\n");
89 } 89 }
90 } 90 }
91 fclose(fp); 91 fclose(fp);