summaryrefslogtreecommitdiffstats
path: root/source/printing
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-11-22 14:20:02 +0000
committerGerald Carter <jerry@samba.org>2005-11-22 14:20:02 +0000
commit60203f23bd7ae622e75327b9b2d9282f03766d01 (patch)
tree100713857559cea0bdf6ac1da139b1d658feaf2d /source/printing
parentae677715dc736601e40d7b60b015a7b0744e0000 (diff)
downloadsamba-60203f23bd7ae622e75327b9b2d9282f03766d01.tar.gz
samba-60203f23bd7ae622e75327b9b2d9282f03766d01.tar.xz
samba-60203f23bd7ae622e75327b9b2d9282f03766d01.zip
r11855: patch from Aruna Prabakar for checking that the spooler si running on HP-UX
Diffstat (limited to 'source/printing')
-rw-r--r--source/printing/print_svid.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/source/printing/print_svid.c b/source/printing/print_svid.c
index 1213b917342..c369e52cd91 100644
--- a/source/printing/print_svid.c
+++ b/source/printing/print_svid.c
@@ -40,10 +40,39 @@ BOOL sysv_cache_reload(void)
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;