comparison lib-src/gnuserv.c @ 5836:c03dd89e0055

Fix gnuserv file descriptor leak. See <CAHCOHQkOV_1sCqb983jD_odRr19eHeU0OLUr-Rxuj+8bVeZ5Sg@mail.gmail.com> in xemacs-patches.
author Jerry James <james@xemacs.org>
date Mon, 08 Dec 2014 16:27:09 -0700
parents b9167d522a9a
children 1044acf60048
comparison
equal deleted inserted replaced
5835:e24390bd4235 5836:c03dd89e0055
319 perror(progname); 319 perror(progname);
320 fprintf(stderr,"%s: unable to recv\n",progname); 320 fprintf(stderr,"%s: unable to recv\n",progname);
321 exit(1); 321 exit(1);
322 } /* if */ 322 } /* if */
323 323
324 close(s);
324 } /* echo_request */ 325 } /* echo_request */
325 326
326 327
327 /* 328 /*
328 handle_response -- accept a response from stdin (the gnu process) and pass the 329 handle_response -- accept a response from stdin (the gnu process) and pass the
856 857
857 if ((s = accept(ls,(struct sockaddr *)&server, &len)) < 0) 858 if ((s = accept(ls,(struct sockaddr *)&server, &len)) < 0)
858 { 859 {
859 perror(progname); 860 perror(progname);
860 fprintf(stderr,"%s: unable to accept\n",progname); 861 fprintf(stderr,"%s: unable to accept\n",progname);
862 return;
861 } /* if */ 863 } /* if */
862 864
863 echo_request(s); 865 echo_request(s);
864 866
865 } /* handle_unix_request */ 867 } /* handle_unix_request */