Print this page
Correctly merge "2991 Allow building without SMB printing support"

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/smbsrv/smbd/smbd_spool.c
          +++ new/usr/src/cmd/smbsrv/smbd/smbd_spool.c
↓ open down ↓ 19 lines elided ↑ open up ↑
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   * Copyright 2012 Nexenta Systems, Inc.  All rights reserved.
  24   24   */
  25   25  
  26   26  /*
  27   27   * CUPS support for the SMB and SPOOLSS print services.
  28   28   */
  29   29  
  30      -#ifndef HAVE_CUPS
  31      -void smbd_load_printers(void) { return; }
  32      -void smbd_cups_init(void) { return; }
  33      -void smbd_cups_fini(void) { return; }
  34      -void smbd_spool_start(void) { return; }
  35      -void smbd_spool_stop(void) { return; }
  36      -#else
  37      -
  38   30  #include <sys/types.h>
  39   31  #include <sys/stat.h>
  40   32  #include <strings.h>
  41   33  #include <syslog.h>
  42   34  #include <signal.h>
  43   35  #include <pthread.h>
  44   36  #include <synch.h>
  45   37  #include <dlfcn.h>
  46   38  #include <errno.h>
  47   39  #include <smbsrv/smb.h>
  48   40  #include <smbsrv/smb_share.h>
  49   41  #include "smbd.h"
  50   42  
       43 +#ifdef  HAVE_CUPS
  51   44  #include <cups/cups.h>
  52   45  
  53   46  #define SMB_SPOOL_WAIT                  2
  54   47  #define SMBD_PJOBLEN                    256
  55   48  #define SMBD_PRINTER                    "Postscript"
  56   49  #define SMBD_FN_PREFIX                  "cifsprintjob-"
  57   50  #define SMBD_CUPS_SPOOL_DIR             "//var//spool//cups"
  58   51  #define SMBD_CUPS_DOCNAME               "generic_doc"
  59   52  
  60   53  typedef struct smbd_printjob {
↓ open down ↓ 453 lines elided ↑ open up ↑
 514  507                          continue;
 515  508  
 516  509                  if (strcasecmp(name, "printer-info") == 0) {
 517  510                          comment = value;
 518  511                          break;
 519  512                  }
 520  513          }
 521  514  
 522  515          (void) strlcpy(si->shr_cmnt, comment, SMB_SHARE_CMNT_MAX);
 523  516  }
 524      -#endif
      517 +
      518 +#else   /* HAVE_CUPS */
      519 +
      520 +/*
      521 + * If not HAVE_CUPS, just provide a few "stubs".
      522 + */
      523 +
      524 +int
      525 +smbd_cups_init(void)
      526 +{
      527 +        return (ENOENT);
      528 +}
      529 +
      530 +void
      531 +smbd_cups_fini(void)
      532 +{
      533 +}
      534 +
      535 +void
      536 +smbd_load_printers(void)
      537 +{
      538 +}
      539 +
      540 +void
      541 +smbd_spool_init(void)
      542 +{
      543 +}
      544 +
      545 +void
      546 +smbd_spool_fini(void)
      547 +{
      548 +}
      549 +
      550 +void
      551 +smbd_spool_start(void)
      552 +{
      553 +}
      554 +
      555 +void
      556 +smbd_spool_stop(void)
      557 +{
      558 +}
      559 +
      560 +#endif  /* HAVE_CUPS */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX