Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cups 1.7.2: build error on system without dnssd/avahi #4402

Closed
michaelrsweet opened this issue Apr 11, 2014 · 9 comments
Closed

cups 1.7.2: build error on system without dnssd/avahi #4402

michaelrsweet opened this issue Apr 11, 2014 · 9 comments

Comments

@michaelrsweet
Copy link
Collaborator

Version: 1.7-current
CUPS.org User: jue

Got the following link error with 1.7.2 on a Linux system without dnssd or avahi installed, same configure works for me with 1.7.1:

...
Linking cupsd...
dirsvc.o: In function cupsdStopBrowsing': dirsvc.c:(.text+0x595): undefined reference todnssdDeregisterAllPrinters'
dirsvc.o: In function cupsdStartBrowsing': dirsvc.c:(.text+0x539): undefined reference todnssdRegisterAllPrinters'
dirsvc.c:(.text+0x568): undefined reference to `dnssdRegisterAllPrinters'
collect2: error: ld returned 1 exit status

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Investigating...

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: appzer0

I can confirm this bug, even with --disable-dnssd --disable-avahi (avahi is intalled but I must disable it for 32-bit building on 64-bit system, just as Archlinux does), it tries to link to dnssd stuff:


  • JOBS=5
  • '[' i686 = i686 ']'
  • export 'CC=gcc -m32'
  • CC='gcc -m32'
  • export 'CXX=g++ -m32'
  • CXX='g++ -m32'
  • FLAGS='-m32 -O2 -march=i686 -pipe'
  • LIBDIRSUFFIX=
  • USE_ARCH=32
  • export PKG_CONFIG_PATH=/usr/lib/pkgconfig
  • PKG_CONFIG_PATH=/usr/lib/pkgconfig
  • export LDFLAGS=-L/usr/lib
  • LDFLAGS=-L/usr/lib
  • sed -i 's@$exec_prefix/lib/cups@$libdir/cups@g' configure
  • CFLAGS='-m32 -O2 -march=i686 -pipe'
  • CXXFLAGS='-m32 -O2 -march=i686 -pipe'
  • ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib --mandir=/usr/man --infodir=/usr/info --docdir=/usr/doc/cups-1.7.2 --disable-avahi --disable-dbus --disable-dnssd --disable-gnutls --disable-gssapi --enable-libusb=no '--with-optim=-m32 -O2 -march=i686 -pipe' --build=i686-0linux-linux-gnu
    checking for gawk... gawk
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc -m32 accepts -g... yes
    checking for gcc -m32 option to accept ISO C89... none needed
    checking how to run the C preprocessor... gcc -m32 -E
    checking whether we are using the GNU C++ compiler... yes
    checking whether g++ -m32 accepts -g... yes
    checking for ranlib... ranlib
    checking for ar... /usr/bin/ar
    checking for chmod... /usr/bin/chmod
    checking for gzip... /usr/bin/gzip
    checking for ld... /usr/bin/ld
    checking for ln... /usr/bin/ln
    checking for mv... /usr/bin/mv
    checking for rm... /usr/bin/rm
    checking for rmdir... /usr/bin/rmdir
    checking for sed... /usr/bin/sed
    checking for xdg-open... /usr/bin/xdg-open
    checking for install-sh script... using /tmp/0-marmite/cups/sources/cups-1.7.2/install-sh
    checking for pkg-config... /usr/bin/pkg-config
    checking for library containing abs... none required
    checking for library containing crypt... -lcrypt
    checking for library containing fmod... -lm
    checking for library containing getspent... none required
    checking for grep that handles long lines and -e... /usr/bin/grep
    checking for egrep... /usr/bin/grep -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking for stdlib.h... (cached) yes
    checking crypt.h usability... yes
    checking crypt.h presence... yes
    checking for crypt.h... yes
    checking langinfo.h usability... yes
    checking langinfo.h presence... yes
    checking for langinfo.h... yes
    checking malloc.h usability... yes
    checking malloc.h presence... yes
    checking for malloc.h... yes
    checking shadow.h usability... yes
    checking shadow.h presence... yes
    checking for shadow.h... yes
    checking for stdint.h... (cached) yes
    checking for string.h... (cached) yes
    checking for strings.h... (cached) yes
    checking bstring.h usability... no
    checking bstring.h presence... no
    checking for bstring.h... no
    checking usersec.h usability... no
    checking usersec.h presence... no
    checking for usersec.h... no
    checking sys/ioctl.h usability... yes
    checking sys/ioctl.h presence... yes
    checking for sys/ioctl.h... yes
    checking sys/param.h usability... yes
    checking sys/param.h presence... yes
    checking for sys/param.h... yes
    checking sys/ucred.h usability... no
    checking sys/ucred.h presence... no
    checking for sys/ucred.h... no
    checking scsi/sg.h usability... yes
    checking scsi/sg.h presence... yes
    checking for scsi/sg.h... yes
    checking iconv.h usability... yes
    checking iconv.h presence... yes
    checking for iconv.h... yes
    checking for library containing iconv_open... none required
    checking mxml.h usability... no
    checking mxml.h presence... no
    checking for mxml.h... no
    checking sys/mount.h usability... yes
    checking sys/mount.h presence... yes
    checking for sys/mount.h... yes
    checking sys/statfs.h usability... yes
    checking sys/statfs.h presence... yes
    checking for sys/statfs.h... yes
    checking sys/statvfs.h usability... yes
    checking sys/statvfs.h presence... yes
    checking for sys/statvfs.h... yes
    checking sys/vfs.h usability... yes
    checking sys/vfs.h presence... yes
    checking for sys/vfs.h... yes
    checking for statfs... yes
    checking for statvfs... yes
    checking for strdup... yes
    checking for strlcat... no
    checking for strlcpy... no
    checking for snprintf... yes
    checking for vsnprintf... yes
    checking for random... yes
    checking for lrand48... yes
    checking for arc4random... no
    checking for geteuid... yes
    checking for setpgid... yes
    checking for vsyslog... yes
    checking for sigaction... yes
    checking for waitpid... yes
    checking for wait3... yes
    checking for tm_gmtoff member in tm structure... yes
    checking for st_gen member in stat structure... no
    checking for removefile... no
    checking for libusb-1.0... yes
    checking zlib.h usability... yes
    checking zlib.h presence... yes
    checking for zlib.h... yes
    checking for gzgets in -lz... yes
    checking for inflateCopy in -lz... yes
    checking for library containing acl_init... -lacl
    checking if GCC supports -fstack-protector... yes
    checking if GCC supports -fPIE... yes
    checking resolv.h usability... yes
    checking resolv.h presence... yes
    checking for resolv.h... yes
    checking for library containing socket... none required
    checking for library containing gethostbyaddr... none required
    checking for library containing getifaddrs... none required
    checking for library containing hstrerror... none required
    checking for library containing rresvport_af... none required
    checking for library containing __res_init... none required
    checking for library containing getaddrinfo... none required
    checking for library containing getnameinfo... none required
    checking for struct sockaddr.sa_len... no
    checking sys/sockio.h usability... no
    checking sys/sockio.h presence... no
    checking for sys/sockio.h... no
    checking for AppleTalk/at_proto.h... no
    checking for poll... yes
    checking for epoll_create... yes
    checking for kqueue... no
    checking pthread.h usability... yes
    checking pthread.h presence... yes
    checking for pthread.h... yes
    checking for pthread_create using -lpthreads... no
    checking for pthread_create using -lpthread... yes
    checking openssl/ssl.h usability... yes
    checking openssl/ssl.h presence... yes
    checking for openssl/ssl.h... yes
    checking for SSL_new in -lssl... yes
    checking for SSL_set_tlsext_host_name... no
    Using SSLLIBS="-lssl -lcrypto"
    Using SSLFLAGS="-DOPENSSL_DISABLE_OLD_DES_SUPPORT"
    checking for dlopen in -ldl... yes
    checking for pam_start in -lpam... no
    checking for pam_set_item in -lpam... no
    checking for pam_setcred in -lpam... no
    checking security/pam_appl.h usability... no
    checking security/pam_appl.h presence... no
    checking for security/pam_appl.h... no
    checking pam/pam_appl.h usability... no
    checking pam/pam_appl.h presence... no
    checking for pam/pam_appl.h... no
    checking for special C compiler options needed for large files... no
    checking for _FILE_OFFSET_BITS value needed for large files... 64
    checking for long long int... yes
    checking for strtoll... yes
    checking for launch_msg... no
    checking launch.h usability... no
    checking launch.h presence... no
    checking for launch.h... no
    checking for default print user... lp
    checking for default print group... lp
    checking for default system groups... "sys root"
    checking for java... /usr/lib64/jdk/bin/java
    checking for perl... /usr/bin/perl
    checking for php-cgi... /usr/bin/php-cgi
    checking for python... /usr/bin/python
    configure: creating ./config.status
    config.status: creating Makedefs
    config.status: creating conf/cups-files.conf
    config.status: creating conf/cupsd.conf
    config.status: creating conf/mime.convs
    config.status: creating conf/pam.std
    config.status: creating conf/snmp.conf
    config.status: creating cups-config
    config.status: creating data/testprint
    config.status: creating desktop/cups.desktop
    config.status: creating doc/help/ref-cups-files-conf.html
    config.status: creating doc/help/ref-cupsd-conf.html
    config.status: creating doc/index.html
    config.status: creating man/client.conf.man
    config.status: creating man/cups-deviced.man
    config.status: creating man/cups-driverd.man
    config.status: creating man/cups-files.conf.man
    config.status: creating man/cups-lpd.man
    config.status: creating man/cups-snmp.man
    config.status: creating man/cupsaddsmb.man
    config.status: creating man/cupsd.conf.man
    config.status: creating man/cupsd.man
    config.status: creating man/lpoptions.man
    config.status: creating scheduler/cups-lpd.xinetd
    config.status: creating scheduler/cups.sh
    config.status: creating scheduler/cups.xml
    config.status: creating scheduler/org.cups.cups-lpd.plist
    config.status: creating templates/header.tmpl
    config.status: creating packaging/cups.list
    config.status: creating doc/ca/index.html
    config.status: creating templates/ca/header.tmpl
    config.status: creating doc/cs/index.html
    config.status: creating templates/cs/header.tmpl
    config.status: creating doc/de/index.html
    config.status: creating templates/de/header.tmpl
    config.status: creating doc/es/index.html
    config.status: creating templates/es/header.tmpl
    config.status: creating doc/fr/index.html
    config.status: creating templates/fr/header.tmpl
    config.status: creating doc/it/index.html
    config.status: creating templates/it/header.tmpl
    config.status: creating doc/ja/index.html
    config.status: creating templates/ja/header.tmpl
    config.status: creating doc/ru/index.html
    config.status: creating templates/ru/header.tmpl
    config.status: creating config.h
  • make -j5
    Using ARCHFLAGS=
    Using ALL_CFLAGS=-I.. -D_CUPS_SOURCE -m32 -O2 -march=i686 -pipe -I/usr/include/libusb-1.0 -DOPENSSL_DISABLE_OLD_DES_SUPPORT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D_REENTRANT
    Using ALL_CXXFLAGS=-I.. -D_CUPS_SOURCE -m32 -O2 -march=i686 -pipe -DOPENSSL_DISABLE_OLD_DES_SUPPORT -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D_REENTRANT
    Using CC=gcc -m32
    Using CXX=gcc -m32
    Using DSOFLAGS=-L../cups -Wl,-soname,all -shared -fPIC -m32 -O2 -march=i686 -pipe -fstack-protector -D_GNU_SOURCE
    Using LDFLAGS=-L../cgi-bin -L../cups -L../filter -L../ppdc -L../scheduler -L/usr/lib -fPIE -pie -fPIC -m32 -O2 -march=i686 -pipe -fstack-protector -D_GNU_SOURCE
    Using LIBS=-lcups -lssl -lcrypto -lz -lpthread -lm -lcrypt -lz
    Making all in cups...
    Compiling adminutil.c...
    Compiling array.c...
    Compiling attr.c...
    Compiling auth.c...
    Compiling backchannel.c...
    Compiling backend.c...
    Compiling conflicts.c...
    Compiling custom.c...
    Compiling debug.c...
    Compiling dest.c...
    Compiling dest-job.c...
    Compiling dest-localization.c...
    Compiling dest-options.c...
    Compiling dir.c...
    Compiling emit.c...
    Compiling file.c...
    Compiling encode.c...
    Compiling getdevices.c...
    Compiling getifaddrs.c...
    Compiling globals.c...
    Compiling getputfile.c...
    Compiling http.c...
    Compiling http-addr.c...
    Compiling http-addrlist.c...
    Compiling http-support.c...
    Compiling ipp.c...
    Compiling ipp-support.c...
    Compiling langprintf.c...
    Compiling language.c...
    Compiling localize.c...
    Compiling mark.c...
    Compiling md5.c...
    Compiling md5passwd.c...
    Compiling notify.c...
    Compiling options.c...
    Compiling page.c...
    Compiling ppd.c...
    Compiling ppd-cache.c...
    Compiling pwg-media.c...
    Compiling request.c...
    Compiling sidechannel.c...
    Compiling snmp.c...
    Compiling snprintf.c...
    Compiling string.c...
    Compiling tempfile.c...
    Compiling thread.c...
    Compiling transcode.c...
    Compiling usersys.c...
    Compiling util.c...
    Archiving libcups.a...
    Linking libcups.so.2...
    a - adminutil.o
    a - array.o
    a - attr.o
    a - auth.o
    a - backchannel.o
    a - backend.o
    a - conflicts.o
    a - custom.o
    a - debug.o
    a - dest.o
    a - dest-job.o
    a - dest-localization.o
    a - dest-options.o
    a - dir.o
    a - emit.o
    a - encode.o
    a - file.o
    a - getdevices.o
    a - getifaddrs.o
    a - getputfile.o
    a - globals.o
    a - http.o
    a - http-addr.o
    a - http-addrlist.o
    a - http-support.o
    a - ipp.o
    a - ipp-support.o
    a - langprintf.o
    a - language.o
    a - localize.o
    a - mark.o
    a - md5.o
    a - md5passwd.o
    a - notify.o
    a - options.o
    a - page.o
    a - ppd.o
    a - ppd-cache.o
    a - pwg-media.o
    a - request.o
    a - sidechannel.o
    a - snmp.o
    a - snprintf.o
    a - string.o
    a - tempfile.o
    a - thread.o
    a - transcode.o
    a - usersys.o
    a - util.o
    Making all in test...
    Compiling ippserver.c...
    Compiling ipptool.c...
    Linking ippserver...
    Linking ipptool...
    Linking ipptool-static...
    Making all in filter...
    Compiling error.c...
    Compiling interpret.c...
    Compiling raster.c...
    Compiling commandtops.c...
    Compiling gziptoany.c...
    Compiling pstops.c...
    Compiling common.c...
    Compiling rastertoepson.c...
    Compiling rastertohp.c...
    Compiling rastertolabel.c...
    Compiling rastertopwg.c...
    Linking libcupsimage.so.2...
    Archiving libcupsimage.a...
    a - error.o
    a - interpret.o
    a - raster.o
    Linking commandtops...
    Linking gziptoany...
    Linking rastertoepson...
    Linking rastertohp...
    Linking rastertolabel...
    Linking rastertopwg...
    Linking pstops...
    Making all in backend...
    Compiling ieee1284.c...
    Compiling network.c...
    Compiling runloop.c...
    Compiling snmp-supplies.c...
    Compiling ipp.c...
    Compiling lpd.c...
    Compiling snmp.c...
    Compiling socket.c...
    Compiling usb.c...
    Archiving libbackend.a...
    a - ieee1284.o
    a - network.o
    a - runloop.o
    a - snmp-supplies.o
    Linking socket...
    Linking snmp...
    Linking lpd...
    Linking usb...
    Linking ipp...
    Making all in berkeley...
    Compiling lpc.c...
    Compiling lpq.c...
    Compiling lpr.c...
    Compiling lprm.c...
    Linking lprm...
    Linking lpc...
    Linking lpr...
    Linking lpq...
    Making all in cgi-bin...
    Compiling help-index.c...
    Compiling html.c...
    Compiling ipp-var.c...
    Compiling search.c...
    Compiling template.c...
    Compiling var.c...
    Compiling websearch.c...
    Compiling admin.c...
    Compiling classes.c...
    Compiling help.c...
    Compiling jobs.c...
    Compiling printers.c...
    Archiving libcupscgi.a...
    a - help-index.o
    a - html.o
    a - ipp-var.o
    a - search.o
    a - template.o
    a - var.o
    Linking libcupscgi.so.1...
    Linking websearch...
    Linking classes.cgi...
    Linking help.cgi...
    Linking jobs.cgi...
    Linking printers.cgi...
    Linking admin.cgi...
    Making all in monitor...
    Compiling bcp.c...
    Compiling tbcp.c...
    Linking tbcp...
    Linking bcp...
    Making all in notifier...
    Compiling mailto.c...
    Compiling testnotify.c...
    Compiling rss.c...
    Linking testnotify...
    Linking rss...
    Linking mailto...
    Making all in ppdc...
    Compiling ppdc-array.cxx...
    Compiling ppdc-attr.cxx...
    Compiling ppdc-catalog.cxx...
    Compiling ppdc-choice.cxx...
    Compiling ppdc-constraint.cxx...
    Compiling ppdc-driver.cxx...
    Compiling ppdc-file.cxx...
    Compiling ppdc-filter.cxx...
    Compiling ppdc-font.cxx...
    Compiling ppdc-group.cxx...
    Compiling ppdc-import.cxx...
    Compiling ppdc-mediasize.cxx...
    Compiling ppdc-message.cxx...
    Compiling ppdc-option.cxx...
    Compiling ppdc-profile.cxx...
    Compiling ppdc-shared.cxx...
    Compiling ppdc-source.cxx...
    Compiling ppdc-string.cxx...
    Compiling ppdc-variable.cxx...
    Compiling ppdc.cxx...
    Compiling ppdi.cxx...
    Compiling ppdhtml.cxx...
    Compiling ppdmerge.cxx...
    Compiling ppdpo.cxx...
    Compiling genstrings.cxx...
    Linking ppdmerge...
    Linking libcupsppdc.so.1...
    Archiving libcupsppdc.a...
    a - ppdc-array.o
    a - ppdc-attr.o
    a - ppdc-catalog.o
    a - ppdc-choice.o
    a - ppdc-constraint.o
    a - ppdc-driver.o
    a - ppdc-file.o
    a - ppdc-filter.o
    a - ppdc-font.o
    a - ppdc-group.o
    a - ppdc-import.o
    a - ppdc-mediasize.o
    a - ppdc-message.o
    a - ppdc-option.o
    a - ppdc-profile.o
    a - ppdc-shared.o
    a - ppdc-source.o
    a - ppdc-string.o
    a - ppdc-variable.o
    Linking genstrings...
    Linking ppdc...
    Linking ppdi...
    Linking ppdhtml...
    Linking ppdpo...
    Generating localization strings...
    Making all in scheduler...
    Compiling filter.c...
    Compiling mime.c...
    Compiling auth.c...
    Compiling type.c...
    Compiling banners.c...
    Compiling cert.c...
    Compiling classes.c...
    Compiling client.c...
    Compiling colorman.c...
    Compiling conf.c...
    Compiling dirsvc.c...
    Compiling env.c...
    Compiling file.c...
    Compiling main.c...
    Compiling ipp.c...
    Compiling listen.c...
    Compiling job.c...
    Compiling log.c...
    Compiling network.c...
    Compiling policy.c...
    Compiling printers.c...
    Compiling process.c...
    Compiling quotas.c...
    Compiling select.c...
    Compiling server.c...
    Compiling statbuf.c...
    Compiling subscriptions.c...
    Compiling sysman.c...
    Compiling tls.c...
    Compiling cupsfilter.c...
    Compiling cups-deviced.c...
    Compiling util.c...
    Compiling cups-driverd.cxx...
    Compiling cups-exec.c...
    Compiling cups-lpd.c...
    Linking libcupsmime.so.1...
    Archiving libcupsmime.a...
    a - filter.o
    a - mime.o
    a - type.o
    Linking cups-deviced...
    Linking cupsfilter...
    Linking cups-exec...
    Linking cups-lpd...
    Linking cupsd...
    Linking cups-driverd...
    dirsvc.o: dans la fonction « cupsdStartBrowsing »:
    dirsvc.c:(.text+0x5c8): référence indéfinie vers « dnssdRegisterAllPrinters »
    dirsvc.o: dans la fonction « cupsdStopBrowsing »:
    dirsvc.c:(.text+0x638): référence indéfinie vers « dnssdDeregisterAllPrinters »
    collect2: erreur: ld a retourné 1 code d'état d'exécution
    Makefile:380: recipe for target 'cupsd' failed
    make[1]: *** [cupsd] Error 1
    make[1]: *** Attente des tâches non terminées....
    Makefile:31: recipe for target 'all' failed
    make: *** [all] Error 1

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: fselles

I too can confirm this bug, when trying to compile with --disable-dnssd --disable-avahi

I think I can track this bug to Commit: ebd5991 [ebd5991] - (Subversion Revision: 11687), it defines at least 2 new functions:

dnssdDeregisterAllPrinters()
dnssdRegisterAllPrinters()

inside a #if block:

#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)

but are called on lines 262 and 244 from outside any #if block:

I've attached a patch that should solve this problem by moving the functions outside the #if block, renaming them to

deregister_all_printers()
register_all_printers()

and surrounding code related to DNSSD and AVAHI inside #if blocks.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet
Copy link
Collaborator Author

"cups-str4402.patch":

--- scheduler/dirsvc.c.str4402 2014-04-24 16:45:32.000000000 +0200
+++ scheduler/dirsvc.c 2014-04-24 16:21:44.000000000 +0200
@@ -50,6 +50,9 @@ static int get_hostconfig(const char *n
static void update_lpd(int onoff);
static void update_smb(int onoff);

+static void deregister_all_printers(int from_callback);
+static void register_all_printers(int from_callback);
+

#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)

ifdef APPLE

@@ -60,12 +63,10 @@ static cupsd_txt_t dnssdBuildTxtRecord(c

ifdef HAVE_AVAHI

static void dnssdClientCallback(AvahiClient _c, AvahiClientState state, void *userdata);

endif /_ HAVE_AVAHI */

-static void dnssdDeregisterAllPrinters(int from_callback);
static void dnssdDeregisterInstance(cupsd_srv_t *srv, int from_callback);
static void dnssdDeregisterPrinter(cupsd_printer_t *p, int clear_name, int from_callback);
static const char *dnssdErrorString(int error);
static void dnssdFreeTxtRecord(cupsd_txt_t *txt);
-static void dnssdRegisterAllPrinters(int from_callback);

ifdef HAVE_DNSSD

static void dnssdRegisterCallback(DNSServiceRef sdRef,
DNSServiceFlags flags,
@@ -241,7 +242,7 @@ cupsdStartBrowsing(void)

  • Register the individual printers
    */
  • dnssdRegisterAllPrinters(0);
  • register_all_printers(0);
    }

@@ -259,7 +260,7 @@ cupsdStopBrowsing(void)

  • De-register the individual printers
    */
  • dnssdDeregisterAllPrinters(0);
  • deregister_all_printers(0);

/*

  • Shut down browsing sockets...
    @@ -540,7 +541,7 @@ dnssdClientCallback(
  • Register the individual printers
    */
  • dnssdRegisterAllPrinters(1);
  • register_all_printers(1);
    break;

case AVAHI_CLIENT_FAILURE:
@@ -552,7 +553,7 @@ dnssdClientCallback(

  • Unregister everything and close the client...
    */

  • dnssdDeregisterAllPrinters(1);
    
  • deregister_all_printers(1);
    

    dnssdDeregisterInstance(&WebIFSrv, 1);
    avahi_client_free(DNSSDClient);
    DNSSDClient = NULL;
    @@ -592,28 +593,6 @@ dnssdClientCallback(

    /*

  • * 'dnssdDeregisterAllPrinters()' - Deregister all printers.

- */

-static void
-dnssdDeregisterAllPrinters(

  • int from_callback) /* I - Deregistering because of callback? */
    -{

- cupsd_printer_t p; / Current printer */

  • if (!DNSSDMaster)

- return;

  • for (p = (cupsd_printer_t *)cupsArrayFirst(Printers);
  •   p;
    
  •   p = (cupsd_printer_t *)cupsArrayNext(Printers))
    
  • if (!(p->type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_SCANNER)))
  •  dnssdDeregisterPrinter(p, 1, from_callback);
    

    -}

    -/*
    • 'dnssdDeregisterInstance()' - Deregister a DNS-SD service instance.
      */

@@ -819,27 +798,6 @@ dnssdFreeTxtRecord(cupsd_txt_t txt) /

/*

  • * 'dnssdRegisterAllPrinters()' - Register all printers.

- */

-static void
-dnssdRegisterAllPrinters(int from_callback) /* I - Called from callback? */
-{

- cupsd_printer_t p; / Current printer */

  • if (!DNSSDMaster)

- return;

  • for (p = (cupsd_printer_t *)cupsArrayFirst(Printers);
  •   p;
    
  •   p = (cupsd_printer_t *)cupsArrayNext(Printers))
    
  • if (!(p->type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_SCANNER)))
  •  dnssdRegisterPrinter(p, from_callback);
    

    -}

    -/*
    • 'dnssdRegisterCallback()' - DNSServiceRegister callback.
      */

@@ -1775,5 +1733,60 @@ update_smb(int onoff) /* I - 1 = turn

/*

  • * 'deregister_all_printers()' - Deregister all printers.
  • */
    +
    +static void
    +deregister_all_printers(
  • int from_callback) /* I - Deregistering because of callback? */
    +{
  • cupsd_printer_t p; / Current printer */

+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)

  • if (!DNSSDMaster)
  • return;
    +#endif /* HAVE_DNSSD || HAVE_AVAHI */
  • for (p = (cupsd_printer_t *)cupsArrayFirst(Printers);
  •   p;
    
  •   p = (cupsd_printer_t *)cupsArrayNext(Printers))
    
  • if (!(p->type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_SCANNER)))
    +#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
  •  dnssdDeregisterPrinter(p, 1, from_callback);
    
    +#else
  •  cupsdDeregisterPrinter(p, 1);
    
    +#endif /* HAVE_DNSSD || HAVE_AVAHI /
    +}
    +
    +
    +/
  • * 'register_all_printers()' - Register all printers.
  • /
    +
    +static void
    +register_all_printers(int from_callback) /
    I - Called from callback? */
    +{
  • cupsd_printer_t p; / Current printer */

+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)

  • if (!DNSSDMaster)
  • return;
    +#endif /* HAVE_DNSSD || HAVE_AVAHI */
  • for (p = (cupsd_printer_t *)cupsArrayFirst(Printers);
  •   p;
    
  •   p = (cupsd_printer_t *)cupsArrayNext(Printers))
    
  • if (!(p->type & (CUPS_PRINTER_REMOTE | CUPS_PRINTER_SCANNER)))
    +#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
  •  dnssdRegisterPrinter(p, from_callback);
    
    +#else
  •  cupsdRegisterPrinter(p);
    
    +#endif /* HAVE_DNSSD || HAVE_AVAHI /
    +}
    +
    +
    +/
    • End of "$Id: dirsvc.c 11688 2014-03-05 21:11:32Z msweet $".
      */

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: dilfridge

Care to update the git export, please? It would be great if we could backport the official fix.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: jue

run into the exact same error with new cups 1.7.3 ...

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Please file a new bug and provide the new output from configure & make...

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: jue

Looks like you forgot to merge the commit
svn+ssh:https://src.apple.com/svn/cups/cups.org/trunk@11871
back into the 1.7 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant