John Malmberg
2002-Jan-07 03:56 UTC
rsync-2.5.1 / socket.c - unititialized variable breaks build.
In socket.c, the variable error is unitilialzed. Also the variable length should be an unsigned int. EAGLE> type socket.gdiff --- ref_src:socket.c Sat Jan 5 13:27:07 2002 +++ lcl_src:socket.c Sun Jan 6 08:40:51 2002 @@ -1,3 +1,4 @@ +/* Converted by prj_src:unix_c_to_vms_c.tpu AND prj_src:socket.tpu on 6-JAN-20 02 08:40:51.01 OPENVMS_AXP */ /* -*- c-file-style: "linux" -*- Copyright (C) 1992-2001 by Andrew Tridgell <tridge@samba.org> @@ -105,7 +106,8 @@ bhints.ai_family = ai_family; bhints.ai_socktype = ai_socktype; bhints.ai_flags = AI_PASSIVE; - if (getaddrinfo(bind_address, NULL, &bhints, &bres_all) == -1) { + error = getaddrinfo(bind_address, NULL, &bhints, &bres_all); + if (error == -1) { rprintf(FERROR, RSYNC_NAME ": getaddrinfo %s: %s\n", bind_address, gai_strerror(error)); return -1; @@ -382,7 +384,7 @@ fd_set fds; int fd; struct sockaddr_storage addr; - int addrlen = sizeof(addr); + unsigned int addrlen = sizeof(addr); /* close log file before the potentially very long select so file can be trimmed by another process instead of growing @@ -565,7 +567,7 @@ char *client_addr(int fd) { struct sockaddr_storage ss; - int length = sizeof(ss); + unsigned int length = sizeof(ss); static char addr_buf[100]; static int initialised; @@ -595,7 +597,7 @@ char *client_name(int fd) { struct sockaddr_storage ss; - int length = sizeof(ss); + unsigned int length = sizeof(ss); static char name_buf[100]; static char port_buf[100]; char *def = "UNKNOWN";
Cameron Simpson
2002-Jan-07 13:28 UTC
rsync-2.5.1 / socket.c - unititialized variable breaks build.
On Sun, Jan 06, 2002 at 10:56:50AM -0600, John Malmberg <wb8tyw@qsl.net> wrote: | In socket.c, the variable error is unitilialzed. | Also the variable length should be an unsigned int. | | | EAGLE> type socket.gdiff | --- ref_src:socket.c Sat Jan 5 13:27:07 2002 | +++ lcl_src:socket.c Sun Jan 6 08:40:51 2002 | @@ -1,3 +1,4 @@ | +/* Converted by prj_src:unix_c_to_vms_c.tpu AND prj_src:socket.tpu on | 6-JAN-20 | 02 08:40:51.01 OPENVMS_AXP */ | /* -*- c-file-style: "linux" -*- | | Copyright (C) 1992-2001 by Andrew Tridgell <tridge@samba.org> | @@ -105,7 +106,8 @@ | bhints.ai_family = ai_family; | bhints.ai_socktype = ai_socktype; | bhints.ai_flags = AI_PASSIVE; | - if (getaddrinfo(bind_address, NULL, &bhints, &bres_all) == -1) { | + error = getaddrinfo(bind_address, NULL, &bhints, &bres_all); | + if (error == -1) { Shouldn't that be "error != 0" ? -- Cameron Simpson, DoD#743 cs@zip.com.au http://www.zip.com.au/~cs/ There's no need to worry about death, it will not happen in your lifetime. - Raymond Smullyan