My favorites
|
Sign in
semicomplete
semicomplete.com projects.
Project Home
Downloads
Wiki
Issues
Source
Checkout
|
Browse
|
Changes
|
‹r2268
r2511
Source path:
svn
/
liboverride
/
bindandswitch.over
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
#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
static int fdconsumed = 0;
override(`bind', `
{
int dupfd;
int port;
int argport;
char *dupfd_str;
char *port_str;
dupfd_str = getenv("BINDFD");
port_str = getenv("BINDPORT");
if (dupfd_str == NULL) {
fprintf(stderr, "BINDFD not set in environment\n");
return -1;
}
if (port_str == NULL) {
fprintf(stderr, "BINDPORT not set in environment\n");
return -1;
}
dupfd = atoi(dupfd_str);
port = htons(atoi(port_str));
argport = ((struct sockaddr_in *)addr)->sin_port;
if (port == argport) {
dup2(dupfd, s);
close(dupfd);
fdconsumed = 1;
return 0;
} else {
return real_func(s, addr, addrlen);
}
return 0;
}
')
Show details
Hide details
Change log
r2269
by jordansissel on Sep 24, 2009
Diff
[No log message]
Go to:
/liboverride/bindandswitch.over
/liboverride/bindandswitch.rb
Project members,
sign in
to write a code review
Older revisions
r2268
by jordansissel on Sep 24, 2009
Diff
[No log message]
r2267
by jordansissel on Sep 24, 2009
Diff
- Add 'bindandswitch' hack
All revisions of this file
File info
Size: 800 bytes, 42 lines
View raw file
Hosted by