projects
/
nbd.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
860a8cb
)
r113: GCC4 warning fixes
author
yoe <yoe>
Tue, 25 Oct 2005 11:12:20 +0000
(11:12 +0000)
committer
yoe <yoe>
Tue, 25 Oct 2005 11:12:20 +0000
(11:12 +0000)
cliserv.h
patch
|
blob
|
history
nbd-client.c
patch
|
blob
|
history
nbd-server.c
patch
|
blob
|
history
diff --git
a/cliserv.h
b/cliserv.h
index
612fa2b
..
569d1ce
100644
(file)
--- a/
cliserv.h
+++ b/
cliserv.h
@@
-75,17
+75,16
@@
void err(const char *s)
{
const int maxlen = 150;
char s1[maxlen], *s2;
{
const int maxlen = 150;
char s1[maxlen], *s2;
- int n = 0;
strncpy(s1, s, maxlen);
strncpy(s1, s, maxlen);
- if (s2 = strstr(s, "%m")) {
+ if ((s2 = strstr(s, "%m"))) {
strcpy(s1 + (s2 - s), strerror(errno));
s2 += 2;
strcpy(s1 + strlen(s1), s2);
}
#ifndef sun
/* Solaris doesn't have %h in syslog */
strcpy(s1 + (s2 - s), strerror(errno));
s2 += 2;
strcpy(s1 + strlen(s1), s2);
}
#ifndef sun
/* Solaris doesn't have %h in syslog */
- else if (s2 = strstr(s, "%h")) {
+ else if ((s2 = strstr(s, "%h"))) {
strcpy(s1 + (s2 - s), hstrerror(h_errno));
s2 += 2;
strcpy(s1 + strlen(s1), s2);
strcpy(s1 + (s2 - s), hstrerror(h_errno));
s2 += 2;
strcpy(s1 + strlen(s1), s2);
diff --git
a/nbd-client.c
b/nbd-client.c
index
285e27a
..
8330906
100644
(file)
--- a/
nbd-client.c
+++ b/
nbd-client.c
@@
-63,7
+63,7
@@
int opennet(char *name, int port)
int main(int argc, char *argv[])
{
int main(int argc, char *argv[])
{
- int port, sock, nbd, one = 1;
+ int port, sock, nbd;
u64 magic, size64;
unsigned long size;
char buf[256] = "\0\0\0\0\0\0\0\0\0";
u64 magic, size64;
unsigned long size;
char buf[256] = "\0\0\0\0\0\0\0\0\0";
diff --git
a/nbd-server.c
b/nbd-server.c
index
fda0c9e
..
9fb9517
100644
(file)
--- a/
nbd-server.c
+++ b/
nbd-server.c
@@
-354,7
+354,6
@@
SERVER* cmdline(int argc, char *argv[]) {
void sigchld_handler(int s) {
int* status=NULL;
int* i;
void sigchld_handler(int s) {
int* status=NULL;
int* i;
- char buf[80];
pid_t pid;
while((pid=wait(status)) > 0) {
pid_t pid;
while((pid=wait(status)) > 0) {
@@
-393,7
+392,6
@@
void killchild(gpointer key, gpointer value, gpointer user_data) {
* is severely wrong).
**/
void sigterm_handler(int s) {
* is severely wrong).
**/
void sigterm_handler(int s) {
- int i;
int parent=0;
g_hash_table_foreach(children, killchild, &parent);
int parent=0;
g_hash_table_foreach(children, killchild, &parent);
@@
-724,6
+722,7
@@
int mainloop(CLIENT *client) {
writeit(client->net, buf, len + sizeof(struct nbd_reply));
DEBUG("OK!\n");
}
writeit(client->net, buf, len + sizeof(struct nbd_reply));
DEBUG("OK!\n");
}
+ return 0;
}
/**
}
/**
@@
-782,7
+781,6
@@
int splitexport(CLIENT* client) {
* @param net A network socket connected to an nbd client
**/
void serveconnection(CLIENT *client) {
* @param net A network socket connected to an nbd client
**/
void serveconnection(CLIENT *client) {
- char buf[80];
splitexport(client);
if (!client->server->expected_size) {
splitexport(client);
if (!client->server->expected_size) {
@@
-879,7
+877,6
@@
void setup_serve(SERVER* serve) {
struct sockaddr_in addrin;
struct sigaction sa;
int addrinlen = sizeof(addrin);
struct sockaddr_in addrin;
struct sigaction sa;
int addrinlen = sizeof(addrin);
- int newpid, i;
#ifndef sun
int yes=1;
#else
#ifndef sun
int yes=1;
#else
@@
-927,7
+924,7
@@
void setup_serve(SERVER* serve) {
**/
int serveloop(SERVER* serve) {
struct sockaddr_in addrin;
**/
int serveloop(SERVER* serve) {
struct sockaddr_in addrin;
- int addrinlen=sizeof(addrin);
+ socklen_t addrinlen=sizeof(addrin);
for(;;) {
CLIENT *client;
int net;
for(;;) {
CLIENT *client;
int net;