Replace perror calls with uniperror

This commit is contained in:
dovecoteescapee 2024-03-02 14:14:02 +03:00
parent 6b484d5988
commit d8334865b4
2 changed files with 7 additions and 7 deletions

6
main.c
View File

@ -360,7 +360,7 @@ int main(int argc, char **argv)
case 'l':
fake_tls.data = ftob(optarg, &fake_tls.size);
if (!fake_tls.data) {
perror("read file");
uniperror("read file");
return -1;
}
break;
@ -368,7 +368,7 @@ int main(int argc, char **argv)
case 'o':
fake_http.data = ftob(optarg, &fake_http.size);
if (!fake_http.data) {
perror("read file");
uniperror("read file");
return -1;
}
break;
@ -376,7 +376,7 @@ int main(int argc, char **argv)
case 'e':
oob_data.data = ftob(optarg, &oob_data.size);
if (!oob_data.data) {
perror("read file");
uniperror("read file");
return -1;
}
break;

View File

@ -529,7 +529,7 @@ static inline int on_tunnel(struct poolhd *pool, struct eval *val,
val->size = n - sn;
if (!(val->tmpbuf = malloc(val->size))) {
perror("malloc");
uniperror("malloc");
return -1;
}
memcpy(val->tmpbuf, buffer + sn, val->size);
@ -552,19 +552,19 @@ int event_loop(int srvfd)
struct poolhd *pool = init_pool(params.max_open * 2 + 1);
if (!pool) {
perror("init pool");
uniperror("init pool");
close(srvfd);
return -1;
}
if (!add_event(pool, EV_ACCEPT, srvfd, 0)) {
perror("add event");
uniperror("add event");
destroy_pool(pool);
close(srvfd);
return -1;
}
char *buffer = malloc(params.bfsize);
if (!buffer) {
perror("malloc");
uniperror("malloc");
destroy_pool(pool);
return -1;
}