Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
f2ca949a
Commit
f2ca949a
authored
Feb 01, 2008
by
Leigh B. Stoller
Browse files
Minor changes to build the proxy code on linux.
parent
0910c65c
Changes
1
Hide whitespace changes
Inline
Side-by-side
tmcd/tmcc.c
View file @
f2ca949a
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2004 University of Utah and the Flux Group.
* Copyright (c) 2000-2004
, 2008
University of Utah and the Flux Group.
* All rights reserved.
*/
...
...
@@ -54,6 +54,9 @@ typedef int socklen_t;
# endif
#endif
#include <setjmp.h>
#ifdef linux
#define strlcpy strncpy
#endif
#ifndef KEYFILE
# define KEYFILE "/etc/emulab.pkey"
...
...
@@ -620,7 +623,7 @@ doudp(char *data, int outfd, struct in_addr serverip, int portnum)
static
int
dounix
(
char
*
data
,
int
outfd
,
char
*
unixpath
)
{
#if
defined(linux) ||
defined(_WIN32)
#if defined(_WIN32)
fprintf
(
stderr
,
"unix domain socket mode not supported on this platform!
\n
"
);
return
-
1
;
#else
...
...
@@ -631,7 +634,7 @@ dounix(char *data, int outfd, char *unixpath)
sunaddr
.
sun_family
=
AF_UNIX
;
strlcpy
(
sunaddr
.
sun_path
,
unixpath
,
sizeof
(
sunaddr
.
sun_path
));
length
=
SUN_LEN
(
&
sunaddr
)
+
1
;
#
ifndef __CYGWIN__
#
if !defined(__CYGWIN__) && !defined(linux)
sunaddr
.
sun_len
=
length
;
# endif
/* __CYGWIN__ */
...
...
@@ -713,7 +716,7 @@ dounix(char *data, int outfd, char *unixpath)
static
void
beproxy
(
char
*
localpath
,
struct
in_addr
serverip
,
char
*
partial
)
{
#if
defined(linux) ||
defined(_WIN32)
#if defined(_WIN32)
fprintf
(
stderr
,
"proxy mode not supported on this platform!
\n
"
);
exit
(
-
1
);
#else
...
...
@@ -736,9 +739,9 @@ beproxy(char *localpath, struct in_addr serverip, char *partial)
sunaddr
.
sun_family
=
AF_UNIX
;
strlcpy
(
sunaddr
.
sun_path
,
localpath
,
sizeof
(
sunaddr
.
sun_path
));
length
=
SUN_LEN
(
&
sunaddr
)
+
1
;
#
ifndef __CYGWIN__
#
if !defined(__CYGWIN__) && !defined(linux)
sunaddr
.
sun_len
=
length
;
#
endif
/* __CYGWIN__ */
#endif
/* __CYGWIN__ */
if
(
bind
(
sock
,
(
struct
sockaddr
*
)
&
sunaddr
,
length
)
<
0
)
{
perror
(
"binding unix domain socket"
);
exit
(
-
1
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment