Fixing some code based on gcc warnings.
authorviric <viriketo@gmail.com>
Sat, 26 May 2012 17:00:48 +0200
changeset 329 b01bb36b4290
parent 328 7f066fdc43c5
child 330 a283e21c1964
Fixing some code based on gcc warnings.
client.c
execute.c
--- a/client.c	Sat May 26 16:57:43 2012 +0200
+++ b/client.c	Sat May 26 17:00:48 2012 +0200
@@ -206,6 +206,8 @@
     version msg. */
 
     res = recv_msg(server_socket, &m);
+    if(res == -1)
+        error("Error calling recv_msg in c_check_version");
     if (m.type != VERSION || m.u.version != PROTOCOL_VERSION)
     {
         printf("Wrong server version. Received %i, expecting %i\n",
@@ -217,6 +219,8 @@
 
     /* Receive also the 2nd send_msg if we got the right version */
     res = recv_msg(server_socket, &m);
+    if(res == -1)
+        error("Error calling the 2nd recv_msg in c_check_version");
 }
 
 void c_show_info()
@@ -404,10 +408,9 @@
 
 void c_show_pid()
 {
-    char *str;
     int pid;
     /* This will exit if there is any error */
-    str = get_output_file(&pid);
+    get_output_file(&pid);
     printf("%i\n", pid);
 }
 
--- a/execute.c	Sat May 26 16:57:43 2012 +0200
+++ b/execute.c	Sat May 26 17:00:48 2012 +0200
@@ -155,8 +155,6 @@
 
     if (command_line.store_output)
     {
-        int res;
-
         if (command_line.gzip)
         {
             int p[2];
@@ -209,7 +207,7 @@
 
         /* Send the filename */
         namesize = sizeof(outfname);
-        res = write(fd_send_filename, (char *)&namesize, sizeof(namesize));
+        write(fd_send_filename, (char *)&namesize, sizeof(namesize));
         write(fd_send_filename, outfname, sizeof(outfname));
     }
     /* Times */