summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-07-03 00:52:56 +0000
committerJeremy Allison <jra@samba.org>2001-07-03 00:52:56 +0000
commit6daea198a8cf7daadd014420ec22e29aba6ca0ad (patch)
treebff7686f002f578ae2a70633c33518a116753af6 /source3/client
parent89ee12d37399ac77f3532f9dfee5e52b7359f552 (diff)
downloadsamba-6daea198a8cf7daadd014420ec22e29aba6ca0ad.tar.gz
samba-6daea198a8cf7daadd014420ec22e29aba6ca0ad.tar.bz2
samba-6daea198a8cf7daadd014420ec22e29aba6ca0ad.zip
Applied Michael Sweet's patch, with one minor signal change.
Jeremy. (This used to be commit 8d1dab74c26d25938de14b34b383890731e9ebd0)
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/smbspool.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c
index 5a78fe14fc..ce920d1a58 100644
--- a/source3/client/smbspool.c
+++ b/source3/client/smbspool.c
@@ -115,7 +115,7 @@ static int smb_print(struct cli_state *, char *, FILE *);
copies = atoi(argv[4]);
/*
- * Fine the URI...
+ * Find the URI...
*/
if (strncmp(argv[0], "smb://", 6) == 0)
@@ -205,11 +205,33 @@ static int smb_print(struct cli_state *, char *, FILE *);
load_interfaces();
- if ((cli = smb_connect(workgroup, server, printer, username, password)) == NULL)
+ do
{
- perror("ERROR: Unable to connect to SAMBA host");
- return (1);
+ if ((cli = smb_connect(workgroup, server, printer, username, password)) == NULL)
+ {
+ if (getenv("CLASS") == NULL)
+ {
+ perror("ERROR: Unable to connect to SAMBA host, will retry in 60 seconds...");
+ sleep (60);
+ }
+ else
+ {
+ perror("ERROR: Unable to connect to SAMBA host, trying next printer...");
+ return (1);
+ }
+ }
}
+ while (cli == NULL);
+
+ /*
+ * Now that we are connected to the server, ignore SIGTERM so that we
+ * can finish out any page data the driver sends (e.g. to eject the
+ * current page... Only ignore SIGTERM if we are printing data from
+ * stdin (otherwise you can't cancel raw jobs...)
+ */
+
+ if (argc < 7)
+ CatchSignal(SIGTERM, SIG_IGN);
/*
* Queue the job...