samba-cvs.cvs
[Top] [All Lists]

svn commit: samba r11855 - branches/SAMBA_3_0/source/printing trunk/sour

Subject: svn commit: samba r11855 - branches/SAMBA_3_0/source/printing trunk/source/printing
From:
Date: Tue, 22 Nov 2005 14:20:03 +0000 GMT
Author: jerry
Date: 2005-11-22 14:20:02 +0000 (Tue, 22 Nov 2005)
New Revision: 11855

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11855

Log:
patch from Aruna Prabakar for checking that the spooler si running on HP-UX
Modified:
   branches/SAMBA_3_0/source/printing/print_svid.c
   trunk/source/printing/print_svid.c


Changeset:
Modified: branches/SAMBA_3_0/source/printing/print_svid.c
===================================================================
--- branches/SAMBA_3_0/source/printing/print_svid.c     2005-11-22 14:13:56 UTC 
(rev 11854)
+++ branches/SAMBA_3_0/source/printing/print_svid.c     2005-11-22 14:20:02 UTC 
(rev 11855)
@@ -40,10 +40,39 @@
        char **lines;
        int i;
 
+#if defined(HPUX)
+       DEBUG(5, ("reloading hpux printcap cache\n"));
+#else
        DEBUG(5, ("reloading sysv printcap cache\n"));
+#endif
 
        if ((lines = file_lines_pload("/usr/bin/lpstat -v", NULL)) == NULL)
+       {
+#if defined(HPUX)
+      
+                      /*
+               * if "lpstat -v" is NULL then we check if schedular is running 
if it is
+               * that means no printers are added on the HP-UX system, if 
schedular is not
+               * running we display reload error.
+               */
+
+               char **scheduler;
+                scheduler = file_lines_pload("/usr/bin/lpstat -r", NULL);
+                if(!strcmp(*scheduler,"scheduler is running")){
+                        DEBUG(3,("No Printers found!!!\n"));
+                       file_lines_free(scheduler);
+                        return True;
+                }
+                else{
+                        DEBUG(3,("Scheduler is not running!!!\n"));
+                       file_lines_free(scheduler);
+                       return False;
+               }
+#else
+               DEBUG(3,("No Printers found!!!\n"));
                return False;
+#endif
+       }
 
        for (i = 0; lines[i]; i++) {
                char *name, *tmp;

Modified: trunk/source/printing/print_svid.c
===================================================================
--- trunk/source/printing/print_svid.c  2005-11-22 14:13:56 UTC (rev 11854)
+++ trunk/source/printing/print_svid.c  2005-11-22 14:20:02 UTC (rev 11855)
@@ -40,10 +40,39 @@
        char **lines;
        int i;
 
+#if defined(HPUX)
+       DEBUG(5, ("reloading hpux printcap cache\n"));
+#else
        DEBUG(5, ("reloading sysv printcap cache\n"));
+#endif
 
        if ((lines = file_lines_pload("/usr/bin/lpstat -v", NULL)) == NULL)
+       {
+#if defined(HPUX)
+      
+                      /*
+               * if "lpstat -v" is NULL then we check if schedular is running 
if it is
+               * that means no printers are added on the HP-UX system, if 
schedular is not
+               * running we display reload error.
+               */
+
+               char **scheduler;
+                scheduler = file_lines_pload("/usr/bin/lpstat -r", NULL);
+                if(!strcmp(*scheduler,"scheduler is running")){
+                        DEBUG(3,("No Printers found!!!\n"));
+                       file_lines_free(scheduler);
+                        return True;
+                }
+                else{
+                        DEBUG(3,("Scheduler is not running!!!\n"));
+                       file_lines_free(scheduler);
+                       return False;
+               }
+#else
+               DEBUG(3,("No Printers found!!!\n"));
                return False;
+#endif
+       }
 
        for (i = 0; lines[i]; i++) {
                char *name, *tmp;

<Prev in Thread] Current Thread [Next in Thread>
  • svn commit: samba r11855 - branches/SAMBA_3_0/source/printing trunk/source/printing, jerry <=