Skip to content
GitLab
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
bcbb8c74
Commit
bcbb8c74
authored
Oct 05, 2009
by
Mike Hibler
Browse files
lint
parent
1f084d47
Changes
2
Hide whitespace changes
Inline
Side-by-side
tmcd/tmcc.c
View file @
bcbb8c74
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-200
4, 2008
University of Utah and the Flux Group.
* Copyright (c) 2000-200
9
University of Utah and the Flux Group.
* All rights reserved.
*/
...
...
@@ -94,6 +94,7 @@ static int dotcp(char *, int, struct in_addr);
static
int
dounix
(
char
*
,
int
,
char
*
);
static
void
beproxy
(
char
*
,
struct
in_addr
,
char
*
);
static
int
dooutput
(
int
,
char
*
,
int
);
static
int
rewritecommand
(
char
*
,
char
*
,
char
**
);
char
*
usagestr
=
"usage: tmcc [options] <command>
\n
"
...
...
@@ -112,8 +113,6 @@ char *usagestr =
" -i Do not use SSL protocol
\n
"
"
\n
"
;
static
int
rewritecommand
(
char
*
,
char
*
,
char
**
);
void
usage
()
{
...
...
@@ -606,8 +605,9 @@ dotcp(char *data, int outfd, struct in_addr serverip)
static
int
doudp
(
char
*
data
,
int
outfd
,
struct
in_addr
serverip
,
int
portnum
)
{
int
sock
,
length
,
n
,
cc
;
int
sock
,
n
,
cc
;
struct
sockaddr_in
name
,
client
;
socklen_t
length
;
char
buf
[
MYBUFSIZE
];
/* Create socket from which to read. */
...
...
@@ -755,8 +755,9 @@ beproxy(char *localpath, struct in_addr serverip, char *partial)
fprintf
(
stderr
,
"proxy mode not supported on this platform!
\n
"
);
exit
(
-
1
);
#else
int
sock
,
newsock
,
cc
,
length
;
int
sock
,
newsock
,
cc
;
struct
sockaddr_un
sunaddr
,
client
;
socklen_t
length
;
char
command
[
MAXTMCDPACKET
],
buf
[
MAXTMCDPACKET
];
char
*
bp
,
*
cp
;
...
...
tmcd/tmcd.c
View file @
bcbb8c74
...
...
@@ -715,7 +715,8 @@ static int
makesockets
(
int
portnum
,
int
*
udpsockp
,
int
*
tcpsockp
)
{
struct
sockaddr_in
name
;
int
length
,
i
,
udpsock
,
tcpsock
;
socklen_t
length
;
int
i
,
udpsock
,
tcpsock
;
/*
* Setup TCP socket for incoming connections.
...
...
@@ -797,7 +798,8 @@ udpserver(int sock, int portnum)
{
char
buf
[
MYBUFSIZE
];
struct
sockaddr_in
client
;
int
length
,
cc
;
socklen_t
length
;
int
cc
;
unsigned
int
nreq
=
0
;
info
(
"udpserver starting: pid=%d sock=%d portnum=%d
\n
"
,
...
...
@@ -858,7 +860,8 @@ tcpserver(int sock, int portnum)
{
char
buf
[
MAXTMCDPACKET
];
struct
sockaddr_in
client
;
int
length
,
cc
,
newsock
;
socklen_t
length
;
int
cc
,
newsock
;
unsigned
int
nreq
=
0
;
struct
timeval
tv
;
...
...
@@ -3550,7 +3553,7 @@ COMMAND_PROTOTYPE(dosfshostid)
* Dig out the hostid. Need to be careful about not overflowing
* the buffer.
*/
sprintf
(
buf
,
"%%%ds"
,
sizeof
(
nodehostid
));
sprintf
(
buf
,
"%%%ds"
,
(
int
)
sizeof
(
nodehostid
));
if
(
sscanf
(
rdata
,
buf
,
nodehostid
)
!=
1
)
{
error
(
"dosfshostid: No hostid reported!
\n
"
);
return
1
;
...
...
@@ -4988,7 +4991,7 @@ COMMAND_PROTOTYPE(doipodinfo)
}
close
(
fd
);
bp
=
hashbuf
;
bp
=
(
char
*
)
hashbuf
;
for
(
i
=
0
;
i
<
sizeof
(
randdata
);
i
++
)
{
bp
+=
sprintf
(
bp
,
"%02x"
,
randdata
[
i
]);
}
...
...
@@ -7573,7 +7576,7 @@ COMMAND_PROTOTYPE(doportregister)
* Dig out the service and the port number.
* Need to be careful about not overflowing the buffer.
*/
sprintf
(
buf
,
"%%%ds %%d"
,
sizeof
(
service
));
sprintf
(
buf
,
"%%%ds %%d"
,
(
int
)
sizeof
(
service
));
rc
=
sscanf
(
rdata
,
buf
,
service
,
&
port
);
if
(
rc
==
0
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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