]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Add debug logging for launchd checkin.
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Tue, 18 Feb 2014 18:12:23 +0000 (18:12 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Tue, 18 Feb 2014 18:12:23 +0000 (18:12 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11596 a1ca3aef-8c08-0410-bb20-df032aa958be

scheduler/main.c

index 934f2d6f405eebae897d879d7079de9c77e94780..7ed396d61e717f0810459a08f28114c7d6a1f7d8 100644 (file)
@@ -1320,6 +1320,8 @@ launchd_checkin(void)
   * Try to match the launchd sockets to the cupsd listeners...
   */
 
+  cupsdLogMessage(CUPSD_LOG_DEBUG, "launchd_checkin: %d listeners.", (int)count);
+
   for (i = 0; i < count; i ++)
   {
    /*
@@ -1334,6 +1336,8 @@ launchd_checkin(void)
       continue;
     }
 
+    cupsdLogMessage(CUPSD_LOG_DEBUG, "launchd_checkin: Listener #%d at fd %d, \"%s\".", (int)i + 1, ld_sockets[i], httpAddrString(&addr, s, sizeof(s)));
+
     for (lis = (cupsd_listener_t *)cupsArrayFirst(Listeners);
         lis;
         lis = (cupsd_listener_t *)cupsArrayNext(Listeners))
@@ -1419,7 +1423,7 @@ launchd_checkin(void)
           == NULL)
   {
     cupsdLogMessage(CUPSD_LOG_ERROR,
-                    "launchd_checkin: No sockets found to answer requests on!");
+                    "launchd_checkin: No sockets found to answer requests on.");
     exit(EXIT_FAILURE);
     return; /* anti-compiler-warning */
   }
@@ -1431,7 +1435,7 @@ launchd_checkin(void)
   if ((ld_array = launch_data_dict_lookup(ld_sockets, "Listeners")) == NULL)
   {
     cupsdLogMessage(CUPSD_LOG_ERROR,
-                    "launchd_checkin: No sockets found to answer requests on!");
+                    "launchd_checkin: No sockets found to answer requests on.");
     exit(EXIT_FAILURE);
     return; /* anti-compiler-warning */
   }
@@ -1444,6 +1448,8 @@ launchd_checkin(void)
   {
     count = launch_data_array_get_count(ld_array);
 
+    cupsdLogMessage(CUPSD_LOG_DEBUG, "launchd_checkin: %d listeners.", (int)count);
+
     for (i = 0; i < count; i ++)
     {
      /*
@@ -1457,12 +1463,12 @@ launchd_checkin(void)
 
        if (getsockname(fd, (struct sockaddr *)&addr, &addrlen))
        {
-         cupsdLogMessage(CUPSD_LOG_ERROR,
-                         "launchd_checkin: Unable to get local address - %s",
-                         strerror(errno));
+         cupsdLogMessage(CUPSD_LOG_ERROR, "launchd_checkin: Unable to get local address for listener #%d: %s", (int)i + 1, strerror(errno));
          continue;
        }
 
+        cupsdLogMessage(CUPSD_LOG_DEBUG, "launchd_checkin: Listener #%d at fd %d, \"%s\".", (int)i + 1, fd, httpAddrString(&addr, s, sizeof(s)));
+
        /*
        * Try to match the launchd socket address to one of the listeners...
        */
@@ -1479,21 +1485,15 @@ launchd_checkin(void)
 
        if (lis)
        {
-         cupsdLogMessage(CUPSD_LOG_DEBUG,
-                 "launchd_checkin: Matched existing listener %s with fd %d...",
-                 httpAddrString(&(lis->address), s, sizeof(s)), fd);
+         cupsdLogMessage(CUPSD_LOG_DEBUG, "launchd_checkin: Matched existing listener #%d to %s.", (int)i + 1, httpAddrString(&(lis->address), s, sizeof(s)));
        }
        else
        {
-         cupsdLogMessage(CUPSD_LOG_DEBUG,
-                 "launchd_checkin: Adding new listener %s with fd %d...",
-                 httpAddrString(&addr, s, sizeof(s)), fd);
+         cupsdLogMessage(CUPSD_LOG_DEBUG, "launchd_checkin: Adding new listener #%d for %s.", (int)i + 1, httpAddrString(&addr, s, sizeof(s)));
 
          if ((lis = calloc(1, sizeof(cupsd_listener_t))) == NULL)
          {
-           cupsdLogMessage(CUPSD_LOG_ERROR,
-                           "launchd_checkin: Unable to allocate listener - "
-                           "%s.", strerror(errno));
+           cupsdLogMessage(CUPSD_LOG_ERROR, "launchd_checkin: Unable to allocate listener: %s.", strerror(errno));
            exit(EXIT_FAILURE);
          }