summaryrefslogtreecommitdiff
path: root/net/sslh/patches/patch-common.c
blob: 4f7fd9c620c62874a9330528df3eeadf725f658b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
$NetBSD: patch-common.c,v 1.3 2021/06/13 12:04:21 rhialto Exp $

Avoid queue variable conflict.

--- common.c.orig	2020-07-30 07:45:50.000000000 +0000
+++ common.c
@@ -338,7 +338,7 @@ int connect_addr(struct connection *cnx,
 }
 
 /* Store some data to write to the queue later */
-int defer_write(struct queue *q, void* data, int data_size)
+int defer_write(struct sslhqueue *q, void* data, int data_size)
 {
     char *p;
     ptrdiff_t data_offset = q->deferred_data - q->begin_deferred_data;
@@ -361,7 +361,7 @@ int defer_write(struct queue *q, void* d
  * Upon success, the number of bytes written is returned.
  * Upon failure, -1 returned (e.g. connexion closed)
  * */
-int flush_deferred(struct queue *q)
+int flush_deferred(struct sslhqueue *q)
 {
     int n;
 
@@ -413,7 +413,7 @@ void dump_connection(struct connection *
  * returns FD_STALLED if data was read, could not be written, and has been
  * stored in temporary buffer.
  */
-int fd2fd(struct queue *target_q, struct queue *from_q)
+int fd2fd(struct sslhqueue *target_q, struct sslhqueue *from_q)
 {
    char buffer[BUFSIZ];
    int target, from, size_r, size_w;
@@ -738,7 +738,7 @@ void setup_syslog(const char* bin_name) 
     }
 
     name1 = strdup(bin_name);
-    res = asprintf(&name2, "%s[%d]", basename(name1), getpid());
+    res = asprintf(&name2, "%s[%d]", basename(name1), (int)getpid());
     CHECK_RES_DIE(res, "asprintf");
 
     for (fn = 0; facilitynames[fn].c_val != -1; fn++)
@@ -861,7 +861,7 @@ void write_pid_file(const char* pidfile)
         exit(3);
     }
 
-    fprintf(f, "%d\n", getpid());
+    fprintf(f, "%d\n", (int)getpid());
     fclose(f);
 }