Description:
added .gitignore to hold empty dirs, fixed deprecation warnings on const char* for box.cc
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@379 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r177:5f8c24384d1c - - 4 files changed: 6 inserted, 2 deleted
@@ -0,0 +1,1 | |||
|
1 | + [^.]* |
@@ -0,0 +1,1 | |||
|
1 | + [^.]* |
@@ -88,59 +88,59 | |||
|
88 | 88 | fprintf(stderr,"wait4: error\n"); |
|
89 | 89 | print_running_stat(0,0,0,max_mem_used); |
|
90 | 90 | } else if (p != box_pid) { |
|
91 | 91 | fprintf(stderr,"wait4: unknown pid %d exited!\n", p); |
|
92 | 92 | print_running_stat(0,0,0,max_mem_used); |
|
93 | 93 | } else { |
|
94 | 94 | if (!WIFEXITED(stat)) |
|
95 | 95 | fprintf(stderr,"wait4: unknown status\n"); |
|
96 | 96 | struct timeval total; |
|
97 | 97 | int wall; |
|
98 | 98 | wall = time(NULL) - start_time; |
|
99 | 99 | timeradd(&rus.ru_utime, &rus.ru_stime, &total); |
|
100 | 100 | |
|
101 | 101 | print_running_stat((double)wall, |
|
102 | 102 | (double) rus.ru_utime.tv_sec + |
|
103 | 103 | ((double) rus.ru_utime.tv_usec/1000000.0), |
|
104 | 104 | (double) rus.ru_stime.tv_sec + |
|
105 | 105 | ((double) rus.ru_stime.tv_usec/1000000.0), |
|
106 | 106 | max_mem_used); |
|
107 | 107 | } |
|
108 | 108 | exit(1); |
|
109 | 109 | } |
|
110 | 110 | |
|
111 | 111 | static void NONRET __attribute__((format(printf,1,2))) |
|
112 | - die(char *msg, ...) | |
|
112 | + die(const char *msg, ...) | |
|
113 | 113 | { |
|
114 | 114 | va_list args; |
|
115 | 115 | va_start(args, msg); |
|
116 | 116 | vfprintf(stderr, msg, args); |
|
117 | 117 | fputc('\n', stderr); |
|
118 | 118 | box_exit(); |
|
119 | 119 | } |
|
120 | 120 | |
|
121 | 121 | static void __attribute__((format(printf,1,2))) |
|
122 | - log(char *msg, ...) | |
|
122 | + log(const char *msg, ...) | |
|
123 | 123 | { |
|
124 | 124 | va_list args; |
|
125 | 125 | va_start(args, msg); |
|
126 | 126 | if (verbose) |
|
127 | 127 | { |
|
128 | 128 | vfprintf(stderr, msg, args); |
|
129 | 129 | fflush(stderr); |
|
130 | 130 | } |
|
131 | 131 | va_end(args); |
|
132 | 132 | } |
|
133 | 133 | |
|
134 | 134 | static void |
|
135 | 135 | valid_filename(unsigned long addr) |
|
136 | 136 | { |
|
137 | 137 | char namebuf[4096], *p, *end; |
|
138 | 138 | static int mem_fd; |
|
139 | 139 | |
|
140 | 140 | if (!file_access) |
|
141 | 141 | die("File access forbidden."); |
|
142 | 142 | if (file_access >= 9) |
|
143 | 143 | return; |
|
144 | 144 | |
|
145 | 145 | if (!mem_fd) |
|
146 | 146 | { |
You need to be logged in to leave comments.
Login now