*
* Copyright (C) 2008 by Vladimir Dronnikov <dronnikov@gmail.com>
*
- * Licensed under GPLv2, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2, see file LICENSE in this source tree.
*/
/*
* mv -f ./"$DATAFILE" save/
*/
+//usage:#define lpd_trivial_usage
+//usage: "SPOOLDIR [HELPER [ARGS]]"
+//usage:#define lpd_full_usage "\n\n"
+//usage: "SPOOLDIR must contain (symlinks to) device nodes or directories"
+//usage: "\nwith names matching print queue names. In the first case, jobs are"
+//usage: "\nsent directly to the device. Otherwise each job is stored in queue"
+//usage: "\ndirectory and HELPER program is called. Name of file to print"
+//usage: "\nis passed in $DATAFILE variable."
+//usage: "\nExample:"
+//usage: "\n tcpsvd -E 0 515 softlimit -m 999999 lpd /var/spool ./print"
+
#include "libbb.h"
// strip argument of bad chars
{
// SECURITY:
size_t max = 4 * 1024; // more than enough for commands!
- return xmalloc_reads(STDIN_FILENO, NULL, &max);
+ return xmalloc_reads(STDIN_FILENO, &max);
}
int lpd_main(int argc, char *argv[]) MAIN_EXTERNALLY_VISIBLE;
while (1) {
char *fname;
int fd;
- // int is easier than ssize_t: can use xatoi_u,
+ // int is easier than ssize_t: can use xatoi_positive,
// and can correctly display error returns (-1)
int expected_len, real_len;