if your caller is going to do perror() on your failure, set errno

Paul A Vixie paul at vix.com
Sun Nov 11 02:45:14 UTC 2001


*** inn-2.2/lib/clientactive.c.orig     Sat Nov 10 15:43:55 2001
--- inn-2.2/lib/clientactive.c  Sat Nov 10 15:44:18 2001
***************
*** 95,102 ****
  FILE *CAlistopen(FILE *FromServer, FILE *ToServer, char *request)
  {
      /* Gotta talk to the server -- see if we can. */
!     if (FromServer == NULL || ToServer == NULL)
        return NULL;
  
      (void)sprintf(CApathname, "%.220s/%s", innconf->pathtmp, _PATH_TEMPACTIVE);
      (void)mktemp(CApathname);
--- 95,104 ----
  FILE *CAlistopen(FILE *FromServer, FILE *ToServer, char *request)
  {
      /* Gotta talk to the server -- see if we can. */
!     if (FromServer == NULL || ToServer == NULL) {
!       errno = EBADF;
        return NULL;
+     }
  
      (void)sprintf(CApathname, "%.220s/%s", innconf->pathtmp, _PATH_TEMPACTIVE);
      (void)mktemp(CApathname);


More information about the inn-workers mailing list