~ubuntu-branches/ubuntu/precise/cups/precise

« back to all changes in this revision

Viewing changes to scheduler/timeout.c

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter, Till Kamppeter, Martin Pitt
  • Date: 2011-10-07 17:01:43 UTC
  • Revision ID: james.westby@ubuntu.com-20111007170143-hjzd479narof18dx
Tags: 1.5.0-8ubuntu1
[ Till Kamppeter ]
* debian/patches/cups-avahi.patch: Updated patch from upstream (Red Hat)
  to fix crashes of the CUPS daemon when using the timeout function call
  functionality (LP: #860691, LP: #860498).

[ Martin Pitt ]
* debian/local/apparmor-profile: Also allow cups to map libraries under
  /usr/local/. (LP: #860765)

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
 */
58
58
 
59
59
static int
 
60
compare_addrs (void *p0, void *p1)
 
61
{
 
62
  if (p0 == p1)
 
63
    return (0);
 
64
  if (p0 < p1)
 
65
    return (-1);
 
66
  return (1);
 
67
}
 
68
 
 
69
static int
60
70
compare_timeouts (cupsd_timeout_t *p0, cupsd_timeout_t *p1)
61
71
{
 
72
  int addrsdiff = compare_addrs (p0, p1);
 
73
  int tvdiff;
 
74
 
 
75
  if (addrsdiff == 0)
 
76
    return (0);
 
77
 
62
78
  if (!p0->enabled || !p1->enabled)
63
79
  {
64
80
    if (!p0->enabled && !p1->enabled)
65
 
      return (0);
 
81
      return (addrsdiff);
66
82
 
67
83
    return (p0->enabled ? -1 : 1);
68
84
  }
69
85
 
70
 
  return (avahi_timeval_compare (&p0->when, &p1->when));
 
86
  tvdiff = avahi_timeval_compare (&p0->when, &p1->when);
 
87
  if (tvdiff != 0)
 
88
    return (tvdiff);
 
89
 
 
90
  return (addrsdiff);
71
91
}
72
92
 
73
93