dtprintinfo: Use CUPS lpq for FreeBSD
authorMarcin Cieslak <saper@saper.info>
Mon, 24 Sep 2012 01:15:02 +0000 (03:15 +0200)
committerJon Trulson <jon@radscan.com>
Mon, 24 Sep 2012 01:41:32 +0000 (19:41 -0600)
Use /usr/local/bin/lpq from CUPS for FreeBSD
for now; this prevents immediate dtprintinfo
crash.

In the future we should handle both built-in
/usr/bin/lpq as well as CUPS /usr/local/bin/lpq
output in separate functions.

Code to support CUPS should probably shared between
other operating systems.

cde/programs/dtprintinfo/objects/PrintObj/ParseJobs.C

index 7a32fdf18dccbfcf632e149f91cc2c332fde74a2..c52d5b2e5b35fd40cb2e4dc09a39700b28871c12 100644 (file)
@@ -870,8 +870,10 @@ void LocalPrintJobs(char *printer, char **return_job_list, int *return_n_jobs)
 #if defined(__osf__)
    sprintf(buf, "lpstat -o%s", printer);
 #endif
-#if defined(linux) || defined(CSRG_BASED)
-   sprintf(buf, "lpq -P%s", printer);
+#if defined(linux) || defined(__OpenBSD__)
+   snprintf(buf, 1000, "lpq -P%s", printer);
+#elif defined(__FreeBSD__)
+   snprintf(buf, 1000, "/usr/local/bin/lpq -P%s", printer);
 #endif
 
    Invoke *_thread = new Invoke(buf, &output);