File: write_check.c

package info (click to toggle)
cti-ifhp 2.2.8-1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 904 kB
  • ctags: 673
  • sloc: ansic: 4,916; sh: 1,539; makefile: 287; perl: 99
file content (31 lines) | stat: -rw-r--r-- 594 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**************************************************************************
 * LPRng IFHP Filter
 * Copyright 1994-1997 Patrick Powell, San Diego, CA <papowell@astart.com>
 *
 * Based on the CTI printer filters.
 *  See COPYRIGHT for details.
 *
 * write_check.c,v 3.2 1998/03/19 14:21:39 papowell Exp
 */

#include "portable.h"
#include "common.h"
#include "hp4.h"


void write_check(fd,str,msg,flg)
int  	 fd,   flg;
char	*str, *msg;
{
	int len;

	len = strlen(str);
	if ( writecn(fd, str, len) != len ){
		if ( flg==DIE ){
			logerr_die( 3, msg );
	 	} else {
			logerr( 3, msg );
		}
	}
}