summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-11-22 14:20:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:30 -0500
commitb1e8785070e0aabf847572e99a767e0e23556d96 (patch)
treecd61d8cf571aee652d3a3411ae4c0ab6b28fe274
parentd93c2b1046dddf3730d393b7a428e61b722987aa (diff)
downloadsamba-b1e8785070e0aabf847572e99a767e0e23556d96.tar.gz
samba-b1e8785070e0aabf847572e99a767e0e23556d96.tar.bz2
samba-b1e8785070e0aabf847572e99a767e0e23556d96.zip
r11855: patch from Aruna Prabakar for checking that the spooler si running on HP-UX
(This used to be commit 017775f2879454f939c35196b3db6d1f2b9d1333)
-rw-r--r--source3/printing/print_svid.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/source3/printing/print_svid.c b/source3/printing/print_svid.c
index 1213b91734..c369e52cd9 100644
--- a/source3/printing/print_svid.c
+++ b/source3/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;