From b1e8785070e0aabf847572e99a767e0e23556d96 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 22 Nov 2005 14:20:02 +0000 Subject: r11855: patch from Aruna Prabakar for checking that the spooler si running on HP-UX (This used to be commit 017775f2879454f939c35196b3db6d1f2b9d1333) --- source3/printing/print_svid.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'source3/printing/print_svid.c') 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; -- cgit