summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--systemv/lpadmin.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/systemv/lpadmin.c b/systemv/lpadmin.c
index f9a1970b5..c608c2d30 100644
--- a/systemv/lpadmin.c
+++ b/systemv/lpadmin.c
@@ -601,27 +601,26 @@ main(int argc, /* I - Number of command-line arguments */
if (num_options || file)
{
- if (!http)
- {
- http = httpConnect2(cupsServer(), ippPort(), NULL, AF_UNSPEC, cupsEncryption(), 1, 30000, NULL);
-
- if (http == NULL)
- {
- _cupsLangPrintf(stderr,
- _("lpadmin: Unable to connect to server: %s"),
- strerror(errno));
- return (1);
- }
- }
-
if (printer == NULL)
{
_cupsLangPuts(stderr,
_("lpadmin: Unable to set the printer options:\n"
- " You must specify a printer name first."));
+ " You must specify a printer name first."));
return (1);
}
+ if (!http)
+ {
+ http = httpConnect2(cupsServer(), ippPort(), NULL, AF_UNSPEC,
+ cupsEncryption(), 1, 30000, NULL);
+
+ if (http == NULL) {
+ _cupsLangPrintf(stderr, _("lpadmin: Unable to connect to server: %s"),
+ strerror(errno));
+ return (1);
+ }
+ }
+
if (set_printer_options(http, printer, num_options, options, file))
return (1);
}