/*
* "$Id$"
*
-* Copyright 2005-2012 Apple Inc. All rights reserved.
+* Copyright 2005-2013 Apple Inc. All rights reserved.
*
* IMPORTANT: This Apple software is supplied to you by Apple Computer,
* Inc. ("Apple") in consideration of your agreement to the following
CFRelease(usb_klass);
CFRelease(usb_subklass);
- kr = IOServiceAddMatchingNotification(addNotification, kIOMatchedNotification, usbPrinterMatchDictionary, &device_added, &reference, &addIterator);
+ IOServiceAddMatchingNotification(addNotification, kIOMatchedNotification, usbPrinterMatchDictionary, &device_added, &reference, &addIterator);
if (addIterator != 0x0)
{
device_added (&reference, addIterator);
/* One last call to the call back now that we are not longer have printers left to iterate...
*/
- if (reference->keepRunning)
+ if (reference->keepRunning && reference->callback)
reference->keepRunning = reference->callback(reference->userdata, 0x0);
if (!reference->keepRunning)
kr = load_classdriver(NULL, interface, &klassDriver);
if (kr == kIOReturnSuccess && klassDriver != NULL)
- kr = copy_deviceid(klassDriver, deviceID);
+ copy_deviceid(klassDriver, deviceID);
unload_classdriver(&klassDriver);
sizeof(mime_type_t *));
}
+ if (compressions)
+ job->compressions = compressions;
+
+ if (filetypes)
+ job->filetypes = filetypes;
+
if (!compressions || !filetypes)
{
cupsdSetJobState(job, IPP_JOB_ABORTED, CUPSD_JOB_PURGE,
return (-1);
}
- job->compressions = compressions;
job->compressions[job->num_files] = compression;
- job->filetypes = filetypes;
job->filetypes[job->num_files] = filetype;
job->num_files ++;
fileid);
}
+ if (compressions)
+ job->compressions = compressions;
+
+ if (filetypes)
+ job->filetypes = filetypes;
+
if (!compressions || !filetypes)
{
cupsdLogMessage(CUPSD_LOG_ERROR,
ippDelete(job->attrs);
job->attrs = NULL;
- if (compressions)
- free(compressions);
-
- if (filetypes)
- free(filetypes);
-
if (job->compressions)
{
free(job->compressions);
return (0);
}
- job->compressions = compressions;
- job->filetypes = filetypes;
- job->num_files = fileid;
+ job->num_files = fileid;
}
job->filetypes[fileid - 1] = mimeFileType(MimeDatabase, jobfile, NULL,
line, linenum);
}
+ if (job)
+ {
+ cupsdLogMessage(CUPSD_LOG_ERROR,
+ "Missing </Job> directive on line %d.", linenum);
+ cupsdDeleteJob(job, CUPSD_JOB_PURGE);
+ }
+
cupsFileClose(fp);
}
*
* cups-lpd test program for CUPS.
*
- * Copyright 2007-2010 by Apple Inc.
+ * Copyright 2007-2013 by Apple Inc.
* Copyright 2006 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
*/
static int do_command(int outfd, int infd, const char *command);
-static int print_job(int outfd, int infd, char *dest, char **args);
+static int print_job(int outfd, int infd, char *dest, char **args) __attribute__((nonnull(4)));
static int print_waiting(int outfd, int infd, char *dest);
-static int remove_job(int outfd, int infd, char *dest, char **args);
-static int status_long(int outfd, int infd, char *dest, char **args);
-static int status_short(int outfd, int infd, char *dest, char **args);
+static int remove_job(int outfd, int infd, char *dest, char **args) __attribute__((nonnull(4)));
+static int status_long(int outfd, int infd, char *dest, char **args) __attribute__((nonnull(4)));
+static int status_short(int outfd, int infd, char *dest, char **args) __attribute__((nonnull(4)));
static void usage(void) __attribute__((noreturn));
*/
op = NULL;
- opargs = NULL;
+ opargs = argv + argc;
dest = NULL;
cupslpd_argc = 1;
cupslpd_argv[0] = (char *)"cups-lpd";