diff options
author | 2010-07-17 01:02:21 +0300 | |
---|---|---|
committer | 2010-07-17 01:02:21 +0300 | |
commit | a3450ee9b714e03d948009f3ef38612e478e6a7f (patch) | |
tree | 2f6863bf6dbad481c61ad62fc31e6f078ee1d40b | |
parent | Fix: string with .o files in Makefile (diff) | |
download | idfetch-a3450ee9b714e03d948009f3ef38612e478e6a7f.tar.gz idfetch-a3450ee9b714e03d948009f3ef38612e478e6a7f.tar.bz2 idfetch-a3450ee9b714e03d948009f3ef38612e478e6a7f.zip |
Fix: warnings with unused variables
-rw-r--r-- | segget/Makefile | 1 | ||||
-rw-r--r-- | segget/proxyfetcher.cpp | 4 | ||||
-rw-r--r-- | segget/segget.cpp | 4 | ||||
-rw-r--r-- | segget/segget.h | 1 | ||||
-rw-r--r-- | segget/ui_server.cpp | 9 | ||||
-rw-r--r-- | segget/ui_server.h | 2 |
6 files changed, 14 insertions, 7 deletions
diff --git a/segget/Makefile b/segget/Makefile index 91de5aa..fe15e2c 100644 --- a/segget/Makefile +++ b/segget/Makefile @@ -26,6 +26,7 @@ segget: segget.o connection.o checksum.o config.o distfile.o mirror.o network.o clean: -rm -f $(BINS) $(OBJS) + -rm -f *.o -rm -f *.log .PRECIOUS: %.o diff --git a/segget/proxyfetcher.cpp b/segget/proxyfetcher.cpp index 67ab164..dc60afa 100644 --- a/segget/proxyfetcher.cpp +++ b/segget/proxyfetcher.cpp @@ -90,7 +90,9 @@ void *run_proxy_fetcher_server(void * ){ debug("removing client on fd:"+toString(fd)); }else{ char buffer[100000]=""; - read(fd, &buffer, nread); + if (nread!=read(fd, &buffer, nread)){ + error_log("Error in proxyfetcher.cpp : run_proxy_fetcher_server(): Not all data has been read from proxy-fetcher-client"); + } debug("serving client - read"); debug("serving client on fd"+toString(fd)); string recv_msg=buffer; diff --git a/segget/segget.cpp b/segget/segget.cpp index 865cca7..4880f98 100644 --- a/segget/segget.cpp +++ b/segget/segget.cpp @@ -277,8 +277,6 @@ int download_pkgs(){ } } -void *print_message_function( void *ptr ); - void launch_tui_thread(){ pthread_t tui_thread; int iret1; @@ -406,7 +404,7 @@ int main() return 0; } -void *print_message_function(void *ptr){ +void *print_message_function(void * ){ while (true){ ulong time_diff_msecs=time_left_from(stats.previous_time); if (time_diff_msecs >= settings.current_speed_time_interval_msecs){ diff --git a/segget/segget.h b/segget/segget.h index ac44294..2a2b76f 100644 --- a/segget/segget.h +++ b/segget/segget.h @@ -61,5 +61,6 @@ int pkg_choose_segment(Tpkg * cur_pkg, uint connection_num); int choose_segment(uint connection_num); int download_pkgs(); int main(); +void *print_message_function( void *); #endif
\ No newline at end of file diff --git a/segget/ui_server.cpp b/segget/ui_server.cpp index dda3da4..f18c399 100644 --- a/segget/ui_server.cpp +++ b/segget/ui_server.cpp @@ -73,7 +73,10 @@ ulong Tui_server::send_to_fd(uint fd, uint y, string msg){ if (fd !=server_sockfd){ if(FD_ISSET(fd,&ui_server.readfds)) { string message="<y>"+toString(y)+"<s>"+msg+"<.>"; - write(fd, message.c_str(), message.length()); + ulong bytes_written=write(fd, message.c_str(), message.length()); + if (bytes_written!=message.length()){ + debug("Error: Not all data has been sent to ui_client()"); + } } } send_to_fd_busy=false; @@ -136,7 +139,9 @@ void *run_ui_server(void * ){ debug("Client parted from fd:"+toString(fd)); }else{ char buffer[1000]; - read(fd, &buffer, nread); + if (nread!=read(fd, &buffer, nread)){ + debug("Not all data has been read from ui_client()"); + } } } } diff --git a/segget/ui_server.h b/segget/ui_server.h index a4c1fa8..6723fc4 100644 --- a/segget/ui_server.h +++ b/segget/ui_server.h @@ -65,6 +65,6 @@ class Tui_server{ extern Tui_server ui_server; -void *run_ui_server(void * ptr); +void *run_ui_server(void *); #endif
\ No newline at end of file |