{
const int maxlen = 150;
char s1[maxlen], *s2;
- int n = 0;
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 */
- 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);
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";
void sigchld_handler(int s) {
int* status=NULL;
int* i;
- char buf[80];
pid_t pid;
while((pid=wait(status)) > 0) {
* is severely wrong).
**/
void sigterm_handler(int s) {
- int i;
int parent=0;
g_hash_table_foreach(children, killchild, &parent);
writeit(client->net, buf, len + sizeof(struct nbd_reply));
DEBUG("OK!\n");
}
+ return 0;
}
/**
* @param net A network socket connected to an nbd client
**/
void serveconnection(CLIENT *client) {
- char buf[80];
splitexport(client);
if (!client->server->expected_size) {
struct sockaddr_in addrin;
struct sigaction sa;
int addrinlen = sizeof(addrin);
- int newpid, i;
#ifndef sun
int yes=1;
#else
**/
int serveloop(SERVER* serve) {
struct sockaddr_in addrin;
- int addrinlen=sizeof(addrin);
+ socklen_t addrinlen=sizeof(addrin);
for(;;) {
CLIENT *client;
int net;