]> code.citadel.org Git - citadel.git/blobdiff - citadel/sysdep.c
Remove all uses of __FUNCTION__ because it is not portable
[citadel.git] / citadel / sysdep.c
index 9f1425bb2ac55b4011ebfb85955c2b2e70da09b4..afcde00696e20a26940f9afb58e89248ddcd9771 100644 (file)
@@ -583,7 +583,7 @@ int client_read_blob(StrBuf *Target, int bytes, int timeout)
 #endif
                retval = client_read_sslblob(Target, bytes, timeout);
                if (retval < 0) {
-                       syslog(LOG_CRIT, "%s failed", __FUNCTION__);
+                       syslog(LOG_CRIT, "client_read_blob() failed");
                }
 #ifdef BIGBAD_IODBG
                snprintf(fn, SIZ, "/tmp/foolog_%s.%d", CCC->ServiceName, CCC->cs_pid);
@@ -626,7 +626,7 @@ int client_read_blob(StrBuf *Target, int bytes, int timeout)
                                                O_TERM,
                                                &Error);
                if (retval < 0) {
-                       syslog(LOG_CRIT, "%s failed: %s\n", __FUNCTION__, Error);
+                       syslog(LOG_CRIT, "client_read_blob() failed: %s", Error);
                        client_close();
                        return retval;
                }
@@ -806,10 +806,9 @@ int CtdlClientGetLine(StrBuf *Target)
                         StrLength(Target), ChrPtr(Target));
                 fclose(fd);
 
-               if (rc < 0)
-                       syslog(LOG_CRIT, 
-                                     "%s failed\n",
-                                     __FUNCTION__);
+               if (rc < 0) {
+                       syslog(LOG_CRIT, "CtdlClientGetLine() failed");
+               }
 #endif
                return rc;
        }
@@ -864,11 +863,9 @@ int CtdlClientGetLine(StrBuf *Target)
                         StrLength(Target), ChrPtr(Target));
                 fclose(fd);
 
-               if ((rc < 0) && (Error != NULL))
-                       syslog(LOG_CRIT, 
-                                     "%s failed: %s\n",
-                                     __FUNCTION__,
-                                     Error);
+               if ((rc < 0) && (Error != NULL)) {
+                       syslog(LOG_CRIT, "CtdlClientGetLine() failed: %s", Error);
+               }
 #endif
                return rc;
        }
@@ -1329,7 +1326,6 @@ void *select_on_master(void *blah)
        int m;
        int i;
        int retval;
-       struct CitContext select_on_master_CC;
 
        CtdlFillSystemContext(&select_on_master_CC, "select_on_master");
        pthread_setspecific(MyConKey, (void *)&select_on_master_CC);
@@ -1354,8 +1350,9 @@ void *select_on_master(void *blah)
                        tv.tv_usec = 0;
                        retval = select(highest + 1, &master_fds, NULL, NULL, &tv);
                }
-               else
-                       return NULL;
+               else {
+                       retval = -1 ;
+               }
 
                /* Now figure out who made this select() unblock.
                 * First, check for an error or exit condition.
@@ -1377,15 +1374,11 @@ void *select_on_master(void *blah)
                                continue;
                        }
                }
-               else if(retval == 0) {
-                       if (server_shutting_down) return(NULL);
-                       continue;
-               }
+
                /* Next, check to see if it's a new client connecting
                 * on a master socket.
                 */
-               else for (serviceptr = ServiceHookTable; serviceptr != NULL;
-                    serviceptr = serviceptr->next ) {
+               else if ((retval > 0) && (!server_shutting_down)) for (serviceptr = ServiceHookTable; serviceptr != NULL; serviceptr = serviceptr->next) {
 
                        if (FD_ISSET(serviceptr->msock, &master_fds)) {
                                ssock = accept(serviceptr->msock, NULL, 0);
@@ -1430,8 +1423,6 @@ void *select_on_master(void *blah)
                        }
                }
        }
-       CtdlClearSystemContext();
-
        return NULL;
 }